Binary, Hex & Octal Converter

About Number Base Conversion

Computers represent all data in binary (base 2) — only 0s and 1s, corresponding to off and on states in transistors. Hexadecimal (base 16) is compact shorthand for binary: each hex digit represents exactly 4 bits, so one byte is always exactly two hex digits. This is why memory addresses, RGB colour codes (#FF5733), error codes, and data dumps are displayed in hex — it maps directly to the underlying binary without any information loss, while being far more compact.

Octal (base 8) was used in older computer systems where word sizes were multiples of 3 bits; Unix/Linux file permissions (chmod 755) remain a common everyday use. In octal, 7 = 111 in binary = read+write+execute; 5 = 101 = read+execute; this makes permission bits easy to visualise. This converter handles non-negative integers. For hexadecimal input, use digits 0–9 and letters A–F (or a–f). Very large numbers beyond 2⁵³ − 1 (9,007,199,254,740,991) may lose precision due to JavaScript's 64-bit floating-point number format.

Sources & references →

Common Conversions

Dec 0= Bin 0 = Oct 0 = Hex 0
Dec 8= Bin 1000 = Oct 10 = Hex 8
Dec 10= Bin 1010 = Oct 12 = Hex A
Dec 15= Bin 1111 = Oct 17 = Hex F
Dec 16= Bin 10000 = Oct 20 = Hex 10
Dec 255= Bin 11111111 = Oct 377 = Hex FF