About the Number Base Converter
A number base converter translates a number between binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). These bases are the four fundamental numeral systems in computing: decimal for humans, binary for the underlying hardware, hexadecimal as a compact human-readable shorthand for binary, and octal as a holdover from older Unix permissions and a handful of legacy contexts.
This converter takes a value in any of the four bases and updates the others live. Edit any field — the rest recompute instantly.
Why hexadecimal exists
Hexadecimal compresses binary by a factor of four: each hex digit represents exactly four binary bits. That makes a 32-bit value readable as 8 hex characters instead of 32 binary characters. Memory addresses, RGB colour values, MAC addresses, hash digests, and bytes in binary file formats are all conventionally written in hex for this reason. You will see hex everywhere in low-level programming.
When you actually need binary or octal
Binary is essential when looking at individual bits — flag fields, bitmasks, low-level protocol headers. Octal survives mainly in Unix file permissions (chmod 755 is octal for rwxr-xr-x) and a few legacy contexts; modern programming languages have largely abandoned octal literals to avoid the famous "leading zero means octal" bug.
How to use the Number Base Converter
Type a value in any base
Binary digits are 0–1, octal 0–7, decimal 0–9, hex 0–9 and A–F.
Read the conversions
All four representations appear simultaneously.
Worked examples
Example 1
Input: 255 in decimal
Result: 11111111₂ · 377₈ · FF₁₆
The largest 8-bit unsigned value.
Example 2
Input: FF in hex
Result: 255₁₀ · 11111111₂
Identical to the previous example, entered from the hex side.
Example 3
Input: 755 in octal
Result: 11101101₂ · 493₁₀ · 1ED₁₆
A common Unix file permission expressed in octal.
Real-world use cases
- Reading or writing CSS colour values in HEX.
- Debugging bit-level flags by viewing the binary representation.
- Converting Unix file mode values between octal and binary.
- Translating between low-level network protocol fields.
- Solving programming puzzles or interview questions that involve base conversion.
Tips & common mistakes
- Hex digits A–F are case-insensitive in every standard tool, so feel free to use upper or lower.
- Leading zeros are significant in binary (they pad to a known bit width) but redundant in decimal. The tool strips redundant leading zeros from the output for readability.
- For very large numbers, JavaScript's number precision tops out at around 2^53. Beyond that you need BigInt; this tool handles values within standard integer ranges.
Frequently asked questions
Why use hex instead of binary?
Hex is much shorter to write (4 bits per character versus 1 bit per character) while remaining easy to convert by hand. It is the standard compromise for human-readable binary.
Is the conversion lossless?
Yes — all four bases represent the same integer value. Switching between them does not lose any information.
How is the conversion done?
Using JavaScript's built-in parseInt with the source radix and Number.prototype.toString with the target radix. The operation is bit-exact.
Does the tool handle negative numbers?
Yes for decimal input. Two's-complement representations of negative numbers in binary or hex require a fixed bit width, which the simple converter does not assume.
Related tools
Last updated: June 2026 · All processing happens locally in your browser.