What Is a Number Base Converter?
A Number Base Converter translates integer values between different positional numeral systems — binary, octal, decimal, and hexadecimal — instantly in your browser. No server, no upload, no data leaving your device.
Supported Number Systems
| Base | Name | Digits | Example |
|---|---|---|---|
| 2 | Binary | 0, 1 | 1010 |
| 8 | Octal | 0–7 | 12 |
| 10 | Decimal | 0–9 | 10 |
| 16 | Hexadecimal | 0–9, A–F | 0xA |
| 2–36 | Custom | 0–9, a–z | z (base 36) |
How to Use
- Type a number into any of the four base fields
- All other bases update instantly
- For negative numbers, prefix with a minus sign (e.g.
-128,-ff) - Select a bit width (8, 16, or 32) to see the two’s complement representation
- Use the Custom Base field to convert to any base from 2 to 36
Formatted Output
Each result field shows the raw digits. The tool uses standard programming prefixes in the two’s complement section:
0b— binary (e.g.0b1010)0o— octal (e.g.0o12)0x— hexadecimal (e.g.0xA)
Negative Numbers and Two’s Complement
When you enter a negative number and select a bit width, the tool shows the two’s complement representation — the method used by virtually all modern processors to store negative integers.
How Two’s Complement Works
For an N-bit system, the two’s complement of a negative number −x is calculated as 2^N − x. For example:
- −1 in 8-bit:
2^8 − 1 = 255→11111111in binary - −128 in 8-bit:
2^8 − 128 = 128→10000000in binary - −1 in 16-bit:
2^16 − 1 = 65535→1111111111111111in binary
The three available bit widths cover the most common integer sizes:
| Bit Width | Range (signed) | Max unsigned |
|---|---|---|
| 8-bit | −128 to 127 | 255 |
| 16-bit | −32,768 to 32,767 | 65,535 |
| 32-bit | −2,147,483,648 to 2,147,483,647 | 4,294,967,295 |
Binary (Base 2)
Binary is the foundation of all digital computing. Each digit (bit) is either 0 or 1, representing the off and on states of transistors. Groups of 8 bits form a byte; 16, 32, and 64-bit groupings are the basis of modern integer types.
Converting decimal to binary: repeatedly divide by 2 and collect remainders from last to first. For example, 10 ÷ 2 = 5 R0, 5 ÷ 2 = 2 R1, 2 ÷ 2 = 1 R0, 1 ÷ 2 = 0 R1 → read remainders bottom-to-top: 1010.
Octal (Base 8)
Octal was historically used in early computing because 3 binary digits map exactly to one octal digit. It is still used in Unix file permissions (e.g. chmod 755) and some low-level programming contexts.
Hexadecimal (Base 16)
Hexadecimal is the most practical shorthand for binary data because 4 bits map exactly to one hex digit. One byte is always exactly two hex characters (00–FF). Hex appears everywhere in computing: HTML colors (#ff6b6b), memory addresses, cryptographic hashes, and assembly language.
Custom Base (Base-N)
Any positional system from base 2 to base 36 is supported. Digits above 9 use letters a–z. Base 36, for example, is used in URL shorteners and compact ID encoding since it uses all alphanumeric characters.
Privacy
All conversions are computed locally in your browser using JavaScript’s built-in integer operations. No number is ever sent to a server, stored, or logged.