Base Converter
Convert numbers between binary, octal, decimal, and hexadecimal. Supports arbitrary precision with BigInt. All conversion happens in your browser.
Input
Output
How to Use the Base Converter
Select the input base (BIN, OCT, DEC, or HEX), then type or paste your number. The tool converts it to all four bases in real time. Common prefixes like 0x, 0b, and 0o are automatically stripped.
Supported Number Bases
- Binary (BIN) — Base 2, digits 0-1. Used by computers at the hardware level; every value in memory is ultimately stored as binary.
- Octal (OCT) — Base 8, digits 0-7. Common in Unix file permissions (e.g.,
chmod 755) and some legacy systems. - Decimal (DEC) — Base 10, digits 0-9. The standard number system used in everyday arithmetic.
- Hexadecimal (HEX) — Base 16, digits 0-9, A-F. Widely used in programming for memory addresses, color codes, and byte values.
Real-World Use Cases
- Color codes — HTML/CSS colors like
#FF5733are hex. Each pair of hex digits (FF, 57, 33) represents the red, green, and blue channel values in decimal (255, 87, 51). - File permissions — Unix permissions like
chmod 755use octal. 7 = read+write+execute (binary 111), 5 = read+execute (binary 101). - Memory addresses — Debuggers and disassemblers display addresses in hex (e.g.,
0x7ffee4b2c8a0) because it maps cleanly to byte boundaries. - Bitwise operations — When working with flags or bitmasks, converting between binary and hex helps visualize which bits are set.
- Network addresses — IPv6 addresses are written in hexadecimal. Understanding base conversion helps read and manipulate them.
Quick Reference: 0–15
| DEC | BIN | OCT | HEX |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 1 | 0001 | 1 | 1 |
| 2 | 0010 | 2 | 2 |
| 3 | 0011 | 3 | 3 |
| 4 | 0100 | 4 | 4 |
| 5 | 0101 | 5 | 5 |
| 6 | 0110 | 6 | 6 |
| 7 | 0111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 9 | 1001 | 11 | 9 |
| 10 | 1010 | 12 | A |
| 11 | 1011 | 13 | B |
| 12 | 1100 | 14 | C |
| 13 | 1101 | 15 | D |
| 14 | 1110 | 16 | E |
| 15 | 1111 | 17 | F |
FAQ
What number bases are supported?
Binary (base 2), Octal (base 8), Decimal (base 10), and Hexadecimal (base 16).
Is there a size limit?
The tool uses BigInt for arbitrary precision, so it can handle very large numbers. Input is limited to 1MB.
Is my data safe?
Yes. All conversion happens in your browser. No data is sent to any server.
How do I convert a hex color to RGB?
Split the hex code into three pairs and convert each from hex to decimal. For example, #1A2B3C → R: 1A = 26, G: 2B = 43, B: 3C = 60. Paste each pair into this tool with HEX selected to get the decimal value instantly.
Why does programming use hexadecimal so often?
One hex digit represents exactly 4 binary bits (a nibble), so two hex digits represent one byte (8 bits). This makes hex a compact and readable shorthand for binary data — far easier to scan than a long string of 0s and 1s.