Math & Geometry
Binary, Hex & Base Converter
Convert whole numbers between binary, octal, decimal, hexadecimal and any base 2–36.
Number systems used in computing
We count in base 10 because we have ten fingers, but computers work in base 2 (binary), using only 0 and 1. Programmers often use base 16 (hexadecimal), with digits 0–9 and A–F, because each hex digit represents exactly four binary digits, which makes long binary values readable: 255 is 11111111 in binary and FF in hex. Base 8 (octal) is still used for Unix file permissions, such as 755.
Enter a whole number and the base it is written in, from 2 to 36, and the converter shows it in decimal, binary, octal and hexadecimal. It uses arbitrary-precision integers, so very long numbers convert exactly.
Where hex and binary appear
Hexadecimal is used for colour codes in web design (#FF5733), memory addresses, MAC addresses, Unicode code points and cryptographic hashes. Binary appears in subnet masks, bit flags and digital electronics. Base 36, using all digits and letters, is sometimes used for short identifiers.
Formula & method
value = Σ digitᵢ × baseⁱWorked example
Convert decimal 255
- 255 = 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 → binary 11111111
- 255 = 15 × 16 + 15 → hex FF
- 255 = 3 × 64 + 7 × 8 + 7 → octal 377
Answer: Binary 11111111, octal 377, hexadecimal FF.
Frequently asked questions
How large can the number be?
Any size — the converter uses arbitrary-precision integers.
How do I convert a hex colour to RGB?
Split it into pairs and convert each: #FF8000 is 255, 128, 0.
What digits are allowed in base 16?
0–9 and A–F, where A = 10 and F = 15.
Can I convert negative numbers?
Yes, with a minus sign. Two's-complement representation is not shown.
What is the largest base?
36, which uses the digits 0–9 and the letters A–Z.
Can I convert fractions?
Not yet; only whole numbers are supported.
What does 0x mean?
A prefix programmers use to mark hexadecimal numbers, as in 0xFF; omit it when entering a number here.
How many bits are in a byte?
Eight, so one byte is exactly two hex digits.