Binary Converter

Binary, hex, decimal, octal

Decimal

Base 10

Binary

Base 2

Octal

Base 8

Hex

Base 16

Custom

Base

How it works

Type a number in any field and the other three update instantly. Hex input accepts letters A-F (case insensitive). Binary only accepts 0 and 1. Fractional and negative numbers are not supported.

The four bases

Decimal (base 10) is the system humans settled on, almost certainly because we have 10 fingers. Each position is a power of 10.

Binary (base 2) is the language of computers. Transistors have two states: on (1) and off (0). Every number, character, image, and instruction on any computer is ultimately represented as a sequence of 1s and 0s. Groups of 8 bits form a byte, which can represent 256 values (0-255).

Hexadecimal (base 16) uses digits 0-9 then A-F for values 10-15. It became the standard shorthand for binary in computing because one hex digit maps exactly to 4 bits, so a byte is always two hex characters (e.g. 255 = FF). This is why colours in CSS are written as #RRGGBB, memory addresses appear as 0x7FFDA3, and file signatures are shown in hex dumps.

Octal (base 8) uses digits 0-7 and maps one digit to exactly 3 bits. It was widely used in early computing (PDP and Unix systems) because early machines often worked with 12-, 24-, or 36-bit word sizes that divided neatly into 3-bit groups. Its main surviving use today is Unix file permissions: chmod 755 sets owner read/write/execute (7), group read/execute (5), others read/execute (5).

Positional notation

All four systems use positional notation: the value of each digit depends on its position. Reading right to left, each position is a successive power of the base.

1101 (binary) = 1×2³ + 1×2² + 0×2¹ + 1×2⁰ = 8+4+0+1 = 13

2A (hex) = 2×16¹ + 10×16⁰ = 32+10 = 42

755 (octal) = 7×8² + 5×8¹ + 5×8⁰ = 448+40+5 = 493