Binary, Decimal & Hex Converter
Convert a value between binary, decimal, hexadecimal and octal in one step, with validation for the base you enter.
How it works
Value = Σ digitᵢ × baseⁱ · e.g. binary 1010 = 1·2³ + 0·2² + 1·2¹ + 0·2⁰ = 10
Every base uses the same idea: each digit’s place value is the base raised to the position’s power. Binary (base 2) is how computers store numbers, hexadecimal (base 16) compresses four binary digits into one and is used for colors and memory addresses, and octal (base 8) groups three bits. Converting between them is just re-expressing the same quantity in different place-value systems.
Worked example
Decimal 255 is 11111111 in binary (eight 1-bits), FF in hexadecimal (15×16 + 15) and 377 in octal. All four notations name the exact same amount.
Sources: Positional notation — Wikipedia
Frequently asked questions
Why is hexadecimal used for colors?
One hex digit represents exactly four binary bits, so two hex digits cover a full byte (0–255). A color like #FF8800 packs three bytes — red, green, blue — into six compact hex digits.
What do the letters A–F mean in hex?
Hexadecimal needs sixteen digit values, so after 0–9 it uses A=10, B=11, C=12, D=13, E=14 and F=15. So hex FF is 15×16 + 15 = 255.
Does this handle a 0x or 0b prefix?
Yes — a leading 0x, 0b or 0o prefix is stripped automatically, so “0xFF” and “FF” both work when hexadecimal is selected.
Related calculators
This calculator is for educational purposes. Double-check important results before acting on them.