Number Base Converter
Convert numbers between binary, octal, decimal and hexadecimal with BigInt support for arbitrarily large values.
Privacy: This tool runs entirely in your browser. Your data never leaves your device and is never uploaded to any server.
Binary (base 2)
11111111
Octal (base 8)
377
Decimal (base 10)
255
Hexadecimal (base 16)
ff
How to use this base converter
- Type a value into any field — binary, octal, decimal or hexadecimal.
- All the other bases update as you type.
- Prefix the input with a minus sign to convert negative numbers.
- Copy whichever representation you need.
The same value in every base
A short reference table is often faster than converting by hand. Reading across a row shows how the same quantity looks in each base.
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 10 | 1010 | 12 | A |
| 255 | 11111111 | 377 | FF |
| 256 | 100000000 | 400 | 100 |
| 1000 | 1111101000 | 1750 | 3E8 |
| 65535 | 1111111111111111 | 177777 | FFFF |
Where each base is used
- Binary (base 2) — how hardware stores values; the base for bit flags and masks.
- Octal (base 8) — legacy Unix file permissions, such as chmod 755.
- Decimal (base 10) — the everyday representation.
- Hexadecimal (base 16) — memory addresses, colour codes, checksums and hashes.
Why hexadecimal is everywhere in programming
Hexadecimal lines up neatly with binary. One hex digit is exactly four bits, so a single byte is always two hex characters. That makes hex far more compact than binary while staying easy to convert by hand, which is why addresses, digests and colour values are almost always written this way.
The 0x prefix used in most languages is only a marker, not part of the number, and the converter accepts values with or without it.
Large numbers and precision
Converting very large values is where naive tools break down. JavaScript numbers lose precision beyond 53 bits, so a big hexadecimal id can come back subtly wrong. This converter uses BigInt, which has no such limit, so 64-bit and 128-bit values survive the round trip exactly.
Common mistakes
- Hexadecimal letters A–F are not case sensitive.
- A decimal number containing 8 or 9 is not valid in octal mode — those digits do not exist in base 8.
- A leading zero does not mean the value is decimal; in some languages it means octal.
- Reading a long binary string is easier when you group it by four bits, one hex digit at a time.
Frequently asked questions
Which number bases are supported?
Binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16).
Does it support large numbers?
Yes. Conversions use JavaScript BigInt, so numbers far beyond the normal 64-bit integer range work correctly.
Can I convert negative numbers?
Yes. Prefix the input with a minus sign to convert negative values.
What is hexadecimal actually used for?
Memory addresses, colour codes, checksums and digests. One hex digit is exactly four bits, so a byte is always two hex characters.
How do I read a long binary number quickly?
Group the bits in fours and convert each group to one hex digit. That is why hex is the readable shorthand for binary.
Why does my octal number contain an 8?
It cannot. Base 8 only uses the digits 0 to 7, so an 8 or a 9 means the value is not octal in the first place.
More Number & Time tools
Unix Timestamp Converter
Convert Unix timestamps to human-readable dates and back, in seconds or milliseconds.
Percentage Calculator
Work out a percentage of a value, what percent one number is of another, and percentage increase or decrease.
Unit Converter
Convert between metric and imperial units of length, weight, volume and temperature instantly.
Age Calculator
Work out an exact age in years, months and days, plus total days lived and time until the next birthday.