Binary Converter: Convert Between Binary, Decimal, Hex & Octal
Published: April 2026 · 9 min read · Computer Science
At the lowest level, every computer speaks in binary — a language of ones and zeros. But as humans, we work with decimal numbers daily, while programmers frequently use hexadecimal and octal systems for memory addresses, color codes, and file permissions. Converting between these number systems is a fundamental skill in computer science, networking, and software development. Our free online binary converter lets you instantly convert between binary, decimal, hexadecimal, and octal with zero hassle. This guide explains how each number system works and walks you through the conversion process step by step.
Understanding Number Systems
Binary (Base-2)
Binary is the foundation of all computing. It uses only two digits — 0 and 1 — and is called base-2 because each position represents a power of 2. Every piece of data in a computer, from text to images to videos, is ultimately stored as binary. A single binary digit is called a bit, and eight bits make a byte, which can represent values from 0 to 255.
Binary: 1 0 1 1 0 1 0 1
Power: 128 64 32 16 8 4 2 1
Value: 128 + 0 + 32 + 16 + 0 + 4 + 0 + 1 = 181
Decimal (Base-10)
Decimal is the number system we use every day. It has ten digits (0-9) and is called base-10 because each position represents a power of 10. While intuitive for humans, decimal is not the most efficient system for representing computer data.
Hexadecimal (Base-16)
Hexadecimal (or "hex") uses sixteen digits: 0-9 and A-F (where A=10, B=11, C=12, D=13, E=14, F=15). Hex is popular in programming because one hex digit represents exactly four binary digits (a nibble), making it a compact way to represent binary data. You will encounter hex in color codes (like #FF6366), memory addresses, MAC addresses, and character encoding.
Octal (Base-8)
Octal uses eight digits (0-7) and was historically popular in computing because each octal digit represents exactly three binary digits. Today, octal is most commonly seen in Unix file permissions (like chmod 755).
How to Use Our Binary Converter
Our binary converter tool supports conversions between all four number systems:
- Open the tool: Go to https://risetop.top/tools/binary-converter/
- Select the input base: Choose binary, decimal, hex, or octal as your input format.
- Enter your number: Type or paste the number you want to convert.
- View all conversions: The tool instantly displays the equivalent value in all four number systems.
- Copy results: Click the copy button next to any conversion result.
The converter handles large numbers, validates input in real time, and runs entirely in your browser for maximum speed and privacy.
Step-by-Step Conversion Examples
Example 1: Decimal to Binary
Convert decimal 42 to binary using the division method:
42 ÷ 2 = 21 remainder 0
21 ÷ 2 = 10 remainder 1
10 ÷ 2 = 5 remainder 0
5 ÷ 2 = 2 remainder 1
2 ÷ 2 = 1 remainder 0
1 ÷ 2 = 0 remainder 1
Read remainders bottom to top: 101010
So, decimal 42 = binary 101010.
Example 2: Binary to Hexadecimal
Convert binary 111100001010 to hexadecimal:
Step 1: Group into sets of 4 bits (pad from left if needed)
1111 0000 1010
Step 2: Convert each group to hex
1111 = 15 = F
0000 = 0 = 0
1010 = 10 = A
Result: F0A
Example 3: Hexadecimal to Decimal
Convert hex 2F3 to decimal:
2F3 = 2 × 16² + F × 16¹ + 3 × 16⁰
= 2 × 256 + 15 × 16 + 3 × 1
= 512 + 240 + 3
= 755
Example 4: Decimal to Octal
Convert decimal 755 to octal:
755 ÷ 8 = 94 remainder 3
94 ÷ 8 = 11 remainder 6
11 ÷ 8 = 1 remainder 3
1 ÷ 8 = 0 remainder 1
Read remainders bottom to top: 1363
So, decimal 755 = octal 1363.
Binary in Real-World Applications
IP Addresses and Subnet Masks
Network engineers frequently convert between binary and decimal when working with IP addresses and subnet masks. For example, the subnet mask 255.255.255.0 in binary is 11111111.11111111.11111111.00000000, which reveals that 24 bits are used for the network portion.
Color Codes
Web developers use hexadecimal to define colors. The color #6366F1 (our brand color) breaks down into RGB values: Red=99 (63 in hex), Green=102 (66), Blue=241 (F1). Each pair of hex digits represents one byte (0-255) of color intensity.
File Permissions in Linux
Unix file permissions use octal notation. The common 755 permission means: owner can read/write/execute (7 = 4+2+1), group can read/execute (5 = 4+0+1), and others can read/execute (5 = 4+0+1). Each digit is a sum of read (4), write (2), and execute (1) permissions.
Character Encoding
Characters in ASCII and Unicode are represented as numbers. The letter A is 65 in decimal, 41 in hex, and 01000001 in binary. Understanding these conversions is essential for working with character encodings, cryptography, and data protocols.
Quick Reference: Number System Equivalents
Decimal Binary Hex Octal
0 0000 0 0
1 0001 1 1
2 0010 2 2
3 0011 3 3
4 0100 4 4
5 0101 5 5
6 0110 6 6
7 0111 7 7
8 1000 8 10
9 1001 9 11
10 1010 A 12
11 1011 B 13
12 1100 C 14
13 1101 D 15
14 1110 E 16
15 1111 F 17
16 10000 10 20
Common Use Cases
- Computer science education: Learning how computers represent and process data at the binary level.
- Networking: Calculating subnet masks, understanding CIDR notation, and working with MAC addresses.
- Web development: Converting hex color codes, understanding CSS color values.
- Embedded systems: Working with microcontroller registers, memory addresses, and bit manipulation.
- Debugging: Reading hex dumps, memory inspection, and reverse engineering.
- Digital design: Logic circuit design, truth tables, and boolean algebra.
Frequently Asked Questions
Why do computers use binary instead of decimal?
Computers use binary because their electronic circuits have two states: on (1) and off (0). Transistors, the building blocks of computer processors, operate as switches that are either conducting electricity or not. Binary is the most reliable and efficient way to represent these two states. While early computers like the ENIAC used decimal, binary proved far simpler and more reliable to implement in hardware.
What is the largest number a byte can represent?
A byte (8 bits) can represent 256 distinct values: from 0 to 255 in unsigned representation, or from -128 to 127 in signed (two's complement) representation. In hex, a byte ranges from 00 to FF.
How do I convert text to binary?
Each character in text is represented by a number in a character encoding standard (usually ASCII or UTF-8). For example, the letter "H" is 72 in decimal, which is 01001000 in binary. Our binary converter handles numeric conversions. For full text-to-binary conversion, look for our dedicated text encoding tools.
Is hexadecimal case-sensitive?
No. In hexadecimal notation, a and A both represent the value 10, f and F both represent 15, and so on. However, it is conventional to use uppercase letters in most programming contexts and lowercase in CSS color codes.
What is the difference between binary and BCD?
Standard binary represents the entire number as a single value. BCD (Binary-Coded Decimal) encodes each decimal digit separately using four binary bits. For example, decimal 42 is 101010 in standard binary but 01000010 in BCD (4=0100, 2=0010). BCD is used in financial calculations and digital displays where exact decimal representation matters.
Related Tools