Hex Converter

Hexadecimal shows up everywhere in computing — colour codes, memory addresses, error codes, MAC addresses — because it packs four binary bits into one readable character. This converts any hex value straight to decimal, binary and octal in one step.

Inputs

Result

420

Binary 110100100 · Octal 644

How the hex converter works

Each hex digit represents exactly 4 binary bits, since hexadecimal is base 16 and 2⁴ = 16 — this is precisely why hex is used as a compact, human-readable stand-in for binary.

To convert to decimal, each digit is multiplied by 16 raised to its position power and summed, exactly like place-value works in base 10 (just with 16 instead of 10 as the base).

A leading '0x' prefix is optional and stripped automatically — it's a common convention marking a value as hexadecimal in code, not part of the number itself.

Worked example: hex value 1A4

  1. 1×16² + A(10)×16¹ + 4×16⁰ = 256 + 160 + 4 = 420 in decimal.
  2. 420 in binary: 110100100.
  3. 420 in octal: 644.

Common mistakes to avoid

Reading hex letters as if they were decimal digits

Hex uses A through F to represent the decimal values 10 through 15 — a common error is treating 'A' as if it means 1 or 10 in a decimal sense rather than its actual positional value of 10 within base 16.

Forgetting hex is case-insensitive by convention

1a4 and 1A4 represent the identical value — hexadecimal letters are conventionally written in either case depending on the context (uppercase is common in some languages, lowercase in others), but the numeric meaning never changes.

Frequently asked questions

Why does computing use hexadecimal instead of just binary or decimal?

Hex is a compact stand-in for binary — since each hex digit maps to exactly 4 bits, a long binary string like 110100100 becomes a much shorter, more readable 1A4 in hex, while still converting to binary trivially, digit by digit.

Where does hexadecimal commonly show up outside of pure programming?

Web colour codes (#1A4F9C), memory addresses in debugging tools, MAC addresses on network hardware, and many error codes and hash outputs are all conventionally shown in hex.

How do I convert hex directly to binary without going through decimal?

Convert each hex digit to its exact 4-bit binary equivalent and concatenate them — 1 becomes 0001, A becomes 1010, 4 becomes 0100, giving 000110100100, which trims to 110100100 once leading zeros are dropped.

What's the largest value a given number of hex digits can represent?

n hex digits can represent values from 0 up to 16ⁿ − 1 — two digits (like FF) max out at 255, matching exactly the range of a single byte.

Learn more

Why Computers 'Speak' in Hex, Not Decimal

Binary is what computers actually use — hex is the readable shorthand humans use to talk about it. Here's why base 16 specifically won.

Related calculators