Binary Hex Octal Converter

Convert numbers between Decimal, Binary, Hexadecimal and Octal — type in any field.

Base 10
Base 2 · digits: 0,1
Base 16 · digits: 0–9, A–F
Base 8 · digits: 0–7

How base conversion works

Every number can be represented in any base by expressing it as powers of that base. The repeated division method is the classic approach for decimal to any base.

Decimal → Binary
Divide by 2, record remainder
Repeat until quotient = 0
13 ÷ 2 = 6 r1, 6 ÷ 2 = 3 r0, 3 ÷ 2 = 1 r1, 1 ÷ 2 = 0 r1 → read remainders bottom-up: 1101
Binary → Decimal
Multiply each bit by 2^position
1101 = 1×8 + 1×4 + 0×2 + 1×1 = 13

Frequently asked questions

What is hexadecimal used for?

Hex is used in computing for memory addresses, colour codes (e.g. #FF5733), byte values, and machine code because 2 hex digits represent exactly 8 bits (one byte), making it compact and human-readable.

Why do computers use binary?

Binary maps perfectly to transistor states (on/off, 1/0). All digital circuits are built on this two-state logic, making binary the natural language of hardware.

What is octal used for?

Octal was popular in early computing (PDP minicomputers) and is still used in Unix file permissions (e.g. chmod 755). Three bits map to one octal digit, so 12-bit and 24-bit words divided cleanly.

What is the maximum number this converter supports?

This converter supports numbers up to 2^32 − 1 (4,294,967,295 in decimal, FFFFFFFF in hex, 11111111...1 in 32-bit binary). For larger numbers, use a dedicated big-integer library.

How do I convert hex colour codes to RGB?

A hex colour like #A3F2C1 splits into A3 (red=163), F2 (green=242), C1 (blue=193) in decimal. You can use this converter on each pair: A3 hex → 163 decimal.