Docutoolbox

Binary / hex / decimal converter

Type a number in any base below — binary, decimal, hexadecimal, or octal — and watch the others update instantly.

Please enter a valid number for this base.

What is the Binary / Hex / Decimal Converter?

This tool converts numbers between the four number systems used most often in computing and mathematics: decimal (base 10, the everyday counting system), binary (base 2, the language of computer hardware), hexadecimal (base 16, widely used in programming and color codes), and octal (base 8, used in some older computing contexts and file permissions).

Type a value into any one field, and the other three update automatically and instantly — there's no separate "convert" button to click, and no data ever leaves your browser.

How to use it

  1. Click into whichever field matches the base of the number you already have.
  2. Type your number. For hexadecimal, both uppercase and lowercase letters (A–F) are accepted.
  3. The other three fields update live as you type, showing the equivalent value in each base.
  4. Click Clear all to reset every field and start over.

If you type an invalid character for a given base — for instance, an "8" in the binary field, which only allows 0 and 1 — the calculator will flag it so you know to correct your entry.

What each number system means

Decimal (Base 10)

The number system almost everyone learns first, using ten digits (0–9). Each position represents a power of 10 — ones, tens, hundreds, and so on.

Binary (Base 2)

Uses only two digits, 0 and 1. Every value in a computer's memory is ultimately stored as binary, because digital circuits are built from switches that are either "on" or "off." Each position represents a power of 2.

Hexadecimal (Base 16)

Uses sixteen symbols: 0–9 followed by A–F, where A=10, B=11, C=12, D=13, E=14, and F=15. Hex is popular in programming because each hex digit maps neatly to exactly four binary digits, making it a compact, human-readable way to represent binary data — it's also the format used for web color codes like #FF6600.

Octal (Base 8)

Uses eight digits, 0–7. It's less common today but still shows up in certain programming contexts and Unix/Linux file permission notation (like chmod 755).

Base comparison table

DecimalBinaryHexOctal
0000
1111
81000810
101010A12
16100001020
25511111111FF377

How the conversion works

Internally, every base is just a different way of writing the same underlying quantity. To convert, the calculator first parses your input as a number in its source base — using positional place values that are powers of that base — and then re-expresses that same quantity using the place-value system of each target base. For example, decimal 255 equals binary 11111111 because 255 = 128+64+32+16+8+4+2+1, which is exactly the sum of the first eight powers of 2 (2⁷ down to 2⁰).

Common uses

  • Computer science coursework and learning how binary and hex relate to decimal
  • Reading and writing hex color codes for web design (e.g., converting RGB decimal values to hex)
  • Understanding IP addresses, memory addresses, or byte values shown in hex in developer tools
  • Working with Unix/Linux file permission numbers in octal
  • Debugging low-level code where values are displayed in a non-decimal base

Frequently asked questions

Does it support negative numbers?

This converter is designed for non-negative whole numbers, which covers the vast majority of practical use cases like color codes, memory addresses, and file permissions.

Can I convert very large numbers?

Yes, the converter handles large integers well beyond typical everyday use, though extremely large values (beyond what JavaScript can represent precisely) may lose some precision.

Why does hexadecimal use letters?

Because hexadecimal needs sixteen distinct symbols but our number system only has ten digits, it borrows the letters A through F to represent the values 10 through 15.

Is hexadecimal the same as "hex code" used for colors?

Yes — a web color code like #3498DB is simply three hexadecimal byte values (one each for red, green, and blue) written back to back.