Number Base Converter

Convert between binary, octal, decimal, and hexadecimal. Edit any field to update the rest.

Common values reference

DecimalBinaryHexOctal
0000
1111
21022
410044
81000810
151111F17
16100001020
321000002040
64100000040100
12711111117F177
1281000000080200
25511111111FF377

About Number Base Converter

Convert between binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16) in real time. Edit any one of the four fields and all others update instantly. The reference table below shows common values in all four bases for quick lookup.

Number systems explained

  • Binary (base 2) — uses only digits 0 and 1. The native language of all digital computers. Every piece of data is ultimately stored and processed as a sequence of binary bits.
  • Octal (base 8) — uses digits 0–7. Each octal digit represents exactly 3 binary bits, making it a convenient shorthand for binary in some legacy systems and Unix file permissions (chmod 755).
  • Decimal (base 10) — the everyday counting system using digits 0–9. What you naturally type when entering a number.
  • Hexadecimal (base 16) — uses digits 0–9 and letters A–F. Each hex digit represents exactly 4 binary bits (a nibble). Widely used in programming for memory addresses, colour codes (#FF5733), byte values, and Unicode code points.

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

  1. Type a value in any base

    Binary digits are 0–1, octal 0–7, decimal 0–9, hex 0–9 and A–F.

  2. 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.