Number Base Converter
NewConvert numbers between binary, octal, decimal, and hexadecimal online for free. Full 64-bit precision using BigInt. Enter a value in any base and all others update instantly. No signup required.
Enter a number in any field to convert to all bases
Prefix: 0b
Prefix: 0o
Prefix: 0x
Common Values Reference
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 16 | 10000 | 20 | 10 |
| 32 | 100000 | 40 | 20 |
| 64 | 1000000 | 100 | 40 |
| 100 | 1100100 | 144 | 64 |
| 128 | 10000000 | 200 | 80 |
| 255 | 11111111 | 377 | FF |
| 256 | 100000000 | 400 | 100 |
| 512 | 1000000000 | 1000 | 200 |
| 1024 | 10000000000 | 2000 | 400 |
| 2048 | 100000000000 | 4000 | 800 |
| 4096 | 1000000000000 | 10000 | 1000 |
| 8192 | 10000000000000 | 20000 | 2000 |
| 16384 | 100000000000000 | 40000 | 4000 |
| 32768 | 1000000000000000 | 100000 | 8000 |
| 65535 | 1111111111111111 | 177777 | FFFF |
| 65536 | 10000000000000000 | 200000 | 10000 |
About this tool
Computers represent numbers internally in binary (base 2), but programmers regularly work with octal (base 8) and hexadecimal (base 16) as well. Hexadecimal is ubiquitous in computing: memory addresses, RGB color codes (#ff6347), file format magic numbers, bitmasks, and network MAC addresses are all expressed in hex. Octal is common in Unix permissions (chmod 755). This tool converts numbers between binary, octal, decimal, and hexadecimal using JavaScript BigInt for full 64-bit precision—enter a value in any field and all others update instantly.
How to use
- 1Type a number into any of the four fields: Binary (base 2), Octal (base 8), Decimal (base 10), or Hexadecimal (base 16).
- 2All other fields update instantly with the converted values.
- 3Prefixes (0b, 0o, 0x) are accepted and stripped automatically.
- 4Values are computed with full 64-bit precision using BigInt — no rounding for large numbers.
Frequently asked questions
- What is hexadecimal (base 16)?
- Hexadecimal uses 16 digits: 0–9 and A–F. Each hex digit maps exactly to 4 binary bits (a nibble), so two hex digits represent one byte (8 bits). This makes hex a compact, human-friendly representation of binary data: 0xFF = 11111111 binary = 255 decimal.
- Why does this tool use BigInt instead of regular numbers?
- JavaScript's standard number type (IEEE 754 double) can only represent integers exactly up to 2^53 (about 9 × 10^15). 64-bit values common in systems programming—like 0xFFFFFFFFFFFFFFFF—would lose precision. BigInt handles arbitrarily large integers exactly.
- What are Unix file permission numbers in octal?
- Unix permissions are three octal digits: owner, group, other. Each digit is a 3-bit mask: 4 = read, 2 = write, 1 = execute. chmod 755 means 111 101 101 binary, or rwxr-xr-x: the owner can read/write/execute; group and others can only read/execute.
- How do I recognize a number's base by its prefix?
- Binary values are prefixed 0b (0b1010), octal with 0o (0o755), and hexadecimal with 0x (0xFF). A number with no prefix and only digits 0–9 is decimal. This tool accepts input with or without these prefixes.