Convert between binary, octal, decimal and hex
Type a whole number, pick the base it is written in, and read all four at once - with the two's complement row that explains why a negative number looks like a string of F.
Applies to CalcMode Base-N converter, /calculator/base-converter · Updated 2026-11-09
One value in, four bases out. The page is the BASE-N mode of the real device with the entry box opened up: you say which base you typed, and every representation appears together instead of one key press at a time.
How to use it
- Type the number in the Value box.
- Set Input base to Decimal DEC, Hexadecimal HEX, Octal OCT or Binary BIN - the default is decimal.
- Press Convert, or Enter.
- Read the four rows: Hexadecimal HEX, Decimal DEC, Octal OCT and Binary BIN.
| You type | Base | DEC | HEX | OCT | BIN |
|---|---|---|---|---|---|
| 255 | DEC | 255 | FF | 377 | 11111111 |
| FF | HEX | 255 | FF | 377 | 11111111 |
| 377 | OCT | 255 | FF | 377 | 11111111 |
| 1010 | BIN | 10 | A | 12 | 1010 |
What it refuses
- Fractions. BASE-N is an integer tool, so 0.5 answers Invalid digits - in the Chinese interface, 不是所选进制的有效数字.
- Letters outside the base: ZZ in hexadecimal is refused for the same reason, while FF is not.
- The machine word still applies: the engine can render a two's complement up to 32 bits, and the page shows the 16-bit one.
Negative numbers and two's complement
Type -5 and you get -101 in binary, -5 in octal, -5 in hex - and one more row: 16-bit two's complement (HEX), which reads FFFB. That extra row is the honest version of what a calculator shows: a real device stores the number as the complement of its machine word, which is why -1 looks like FFFF on a 16-bit display and FF on an 8-bit one.
Linking straight in
The page reads two query parameters: value for the number and from for its base, and from only accepts 2, 8, 10 or 16. A base the page does not know falls back to decimal, so ?value=255&from=7 shows 255 as a decimal number rather than an error.
Open the tool
These links go straight to the web tool. The ones that carry an example open with it already filled in, so the result appears without typing anything; the rest open the tool ready for your own input.