How it works
The base of a number indicates how many symbols it uses to represent itself. Decimal (base 10) uses 0 to 9; binary (base 2) only 0 and 1; octal (base 8) 0 to 7; and hexadecimal (base 16) 0 to 9 plus the letters A to F.
The number's value does not change, only its writing. This tool takes a number in the base you choose and instantly shows it in binary, octal, decimal, and hexadecimal, plus any custom base from 2 to 36.
Hexadecimal is popular in programming because each digit corresponds to exactly 4 bits, so two digits represent a byte. That is why it is used in CSS colors, memory addresses, and data dumps.
Examples
255FF (hex) · 11111111 (bin) · 377 (oct)255 in decimal is the maximum value of a byte: eight ones in binary and FF in hexadecimal.2A42 (dec) · 101010 (bin) · 52 (oct)Input in hexadecimal: 2A equals 42 in decimal.DEAD57005 (dec)Hexadecimal allows "words" like DEAD or BEEF, widely used as test values in memory.Use cases
- Convert the hexadecimal value of a color, a bit mask, or a register to decimal to understand it.
- Convert a decimal number to binary to work with flags, permissions, or bit-level operations.
- Manually verify the conversion your code does when reading or writing data in different bases.
Frequently asked questions
What do the 0x, 0b, and 0o prefixes mean?
They are conventions to indicate the base in code: 0x precedes a hexadecimal (0xFF), 0b a binary (0b1010), and 0o an octal (0o777). They only mark how to read the digits that follow.
Why does hexadecimal use letters?
Because it needs 16 symbols and the digits 0-9 only reach ten. The letters A to F represent the values 10 to 15.
Up to which base can I use?
Up to base 36, which exhausts the ten digits and the 26 letters of the alphabet (0-9 and A-Z). It is the limit of what can be represented with alphanumeric characters.
Does it convert numbers with decimals?
It is designed for whole numbers. Converting fractions between bases produces, in many cases, infinite expansions and is not covered here.