Binary / Hex / Octal Converter
Base 2 (Binary) ยท Base 8 (Octal) ยท Base 10 (Decimal) ยท Base 16 (Hex)
Convert between binary, decimal, hexadecimal and octal number systems instantly. Type in any field โ all others update in real time. Essential for programmers, CS students and hardware engineers working with different number bases.
About Number Bases
A number base (or radix) determines how many unique digits a positional numeral system uses. Our everyday system uses base 10 (ten digits: 0โ9). Computing hardware operates in base 2 (binary) because electronic circuits have two states. Programmers use base 16 (hexadecimal) as a compact binary shorthand. Base 8 (octal) was popular in early computing and persists in Unix/Linux file permission notation. All four bases represent the same underlying value โ just in different notations.
๐ Decimal & Binary โ Base 10 and Base 2
Decimal (base 10) uses digits 0โ9. It is the system humans use naturally, likely because we have ten fingers. Binary (base 2) uses only 0 and 1. Every bit in a computer is a binary digit โ a transistor either passes current (1) or doesn't (0). All CPU instructions, memory addresses, file data and network packets are ultimately binary. An 8-bit byte can hold 256 values (0โ255). A 32-bit integer holds over 4 billion values. Converting between binary and decimal is the most fundamental skill in computer science.
๐ก Hexadecimal & Octal โ Base 16 and Base 8
Hexadecimal (base 16) uses digits 0โ9 plus letters AโF (A=10, B=11, C=12, D=13, E=14, F=15). Each hex digit maps to exactly 4 binary bits, making it a compact and human-readable binary representation. Colors in CSS (#RRGGBB), memory addresses (0x7FFF1234), and machine code are all expressed in hex. Octal (base 8) uses digits 0โ7, with each octal digit mapping to 3 binary bits. Linux file permissions use octal โ chmod 755 means owner: read/write/execute (7=111), group: read/execute (5=101), others: read/execute (5=101).
Number Base Reference Table (0โ15)
The same values expressed in all four bases. Hex letters AโF map to decimal 10โ15.
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 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 | 10 | 8 |
| 9 | 1001 | 11 | 9 |
| 10 | 1010 | 12 | A |
| 11 | 1011 | 13 | B |
| 12 | 1100 | 14 | C |
| 13 | 1101 | 15 | D |
| 14 | 1110 | 16 | E |
| 15 | 1111 | 17 | F |
Common Number Base Conversions
Worked Examples
6 รท 2 = 3 r0
3 รท 2 = 1 r1
1 รท 2 = 0 r1 โ 1101
โ 1111 | 1111
โ F | F โ FF
= 32 + 15 = 47
7=111, 5=101, 5=101
โ rwxr-xr-x
Explore All Conversions
People Also Ask โ Binary & Hex
Who Uses a Binary / Hex Converter?
Mental Math Tips โ Number Bases
Memorise powers of 2: 1, 2, 4, 8, 16, 32, 64, 128, 256. To convert 200: 128 fits (1), remainder 72. 64 fits (1), remainder 8. 8 fits (1). So 200 = 11001000. The "greedy subtraction" method works faster than repeated division once you know the powers.
Group in 4s from the right and memorise the 16 nibble values (0000=0 through 1111=F). With practice this becomes instant: seeing 1010 immediately reads as A, 1111 as F, 0110 as 6. This is the fastest mental path between binary and hex โ no arithmetic needed.
For 2-digit hex (one byte): multiply the first digit by 16 and add the second. 0xA4 = 10ร16 + 4 = 164. For single digit hex: A=10, B=11, C=12, D=13, E=14, F=15 โ just memorise these six. Everything else (0โ9) is the same as decimal.