Number Base Converter
Enter a number, pick its base, and see all four bases at once.
Developer tool
Convert numbers between binary, octal, decimal, and hexadecimal - instantly and exactly.
Enter a number, pick its base, and see all four bases at once.
More developer and data utilities.
Type a value into the Number field, then use the Input base menu to tell the tool which base you typed it in: decimal, binary, octal, or hexadecimal. As soon as you do, the binary, octal, decimal, and hexadecimal forms all appear together and stay in sync the moment you change a digit. Each result has its own Copy button so you can drop a value straight into code, a calculator, or a config file. Hex letters can be typed in upper or lower case, and the tool ignores common prefixes such as 0x for hex or 0b for binary, so pasting a value from source code just works.
A base, or radix, is simply how many distinct digits a counting system uses before it rolls over into a new column. Decimal (base 10) uses ten digits, 0 through 9; binary (base 2) uses only 0 and 1; octal (base 8) uses 0 through 7; and hexadecimal (base 16) uses 0 through 9 plus the letters A to F to stand for ten through fifteen. The important idea is that all four are different costumes for the same underlying quantity. The value written as 255 in decimal is the exact same amount as 11111111 in binary, 377 in octal, and FF in hexadecimal. Converting between bases never changes the number, only the way it is spelled, which is why this tool can show every form at once.
Seeing small numbers in all four bases at once makes the pattern click faster than any rule can. The table below counts from zero upward and shows how each base writes the same value. Notice how hexadecimal switches to letters once it passes nine, and how binary grows an extra column at every power of two.
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
0 | 0 | 0 | 0 |
2 | 10 | 2 | 2 |
8 | 1000 | 10 | 8 |
10 | 1010 | 12 | A |
15 | 1111 | 17 | F |
16 | 10000 | 20 | 10 |
Each hexadecimal digit maps to exactly four binary digits, which is why programmers reach for hex to read long binary strings at a glance.
To turn decimal 156 into hexadecimal, divide by 16: 156 divided by 16 is 9 with a remainder of 12, and 12 is the hex digit C, so 156 becomes 9C. To go to binary, you can use the four-bits-per-hex-digit shortcut: 9 is 1001 and C is 1100, so 156 is 10011100. Grouping that binary three digits at a time from the right gives 234 in octal. Enter 156 in the tool with decimal selected and you will see exactly these results, which is a quick way to check the arithmetic you do on paper.
Anyone who reads or writes low-level code crosses between bases all day. Hexadecimal shows up in CSS color codes like #1A2B3C, in memory addresses and pointers, in byte values from network packets, and in error codes. Binary is where bitmasks, permission flags, and bitwise operators live, while decimal is the form people actually reason about. Doing these conversions in your head is slow and error prone, especially once letters and longer values are involved, so seeing all four notations update together removes a whole category of small mistakes and saves you from juggling a separate calculator.
The converter uses arbitrary-precision big-integer arithmetic, so there is no 32-bit or 64-bit ceiling and no rounding: a hundred-digit number converts as exactly as a single digit. It also runs entirely in your browser. The number you type is processed on your own device and is never uploaded, logged, or stored on a server, which means you can safely convert addresses, identifiers, or any other sensitive value without it leaving your machine.
Computers store everything as on/off transistor states, which map directly to the two digits of binary, 0 and 1, so binary is the natural language of the hardware. Hexadecimal is used by people because each hex digit represents exactly four binary digits, packing a long binary string into a quarter of the characters while staying trivial to convert back. Decimal stays in use for everyday human math, where ten fingers rather than two voltages set the convention.
Every number has a single true value no matter how it is written; only the notation changes. To read a number in any base you multiply each digit by the base raised to its position and add the results, which gives the decimal value. To write that value in a target base you repeatedly divide by the base and collect the remainders from last to first. This tool does both steps for you, so you enter the number once and read all four notations together.
Yes, by sign and magnitude: type a minus sign in front of the value and the converted forms keep that minus sign. This is the everyday human reading of a negative number, and it differs from the two's complement representation a CPU stores in a fixed-width register, where the same value appears as a long run of leading ones with no minus sign at all.
No. Leading zeros never change a number's value in any base, so 0x00FF and 0xFF are the same number. They are kept only to pad a value to a fixed width, such as showing a byte as eight binary digits or two hex digits, which makes columns line up and bit positions easier to read.
Yes to both. It uses arbitrary-precision big-integer math, so values far beyond 64 bits convert exactly with no rounding. Every conversion runs locally in your browser, so the number you enter is never uploaded or stored on any server.