Number Base Converter
Convert integers between decimal, hexadecimal, octal, and binary, live, with support for negative values and 0x/0o/0b prefixes.
How to use the Number Base Converter
- Type a number into any of the four fields: Decimal, Hexadecimal, Octal, or Binary.
- The other three fields update immediately as you type.
- A
0x,0o, or0bprefix is optional on the matching field — paste a value with or without one. - For negative numbers, type a leading
-in any field; the other fields update with the equivalent negative value. - Use each field's Copy button to copy that value. For Binary, the grouping spaces shown on screen are stripped automatically, so the copied text is a plain digit string.
How This Tool Works
Type an integer into any of the four fields — Decimal, Hexadecimal, Octal, or Binary — and the other three update instantly, computed with exact arbitrary-precision integer math, so even very large numbers convert without floating-point rounding errors.
Pasting a value with a common prefix works directly: 0x2A and 2A both convert the same way in the Hexadecimal field, 0o52 and 52 the same way in Octal, and 0b101010 and 101010 the same way in Binary — the prefix is recognized and stripped automatically.
Negative numbers are supported with a leading minus sign in any field — for example, -42 in Decimal becomes -2a in Hexadecimal. This tool uses sign-and-magnitude, not two's complement, so there's no bit width to configure.
Long binary values are shown grouped into 4-digit clusters (e.g. 1010 1010) once you switch to another field, purely for readability — each field's Copy button always copies the ungrouped digit string, ready to paste straight into code.