home / Math / hex calculator

Hex Calculator

The Hex Calculator is a free online tool for hexadecimal arithmetic and conversion. Base 16 is used throughout computing because each hex digit maps exactly to four binary digits, which makes it a compact way to write binary.

Modify the values and click the Calculate button to use.

Related: Binary Calculator | Scientific Notation Calculator | IP Subnet Calculator

Base 16 and Why It Exists

Hexadecimal uses sixteen digits: 0–9 then A–F for ten to fifteen. Its value in computing comes from one fact — each hex digit corresponds to exactly four binary digits, so any binary string converts to hex by grouping in fours, with no arithmetic at all.

Hex Digit Chart

HexDecimalBinaryHexDecimalBinary
000000881000
110001991001
220010A101010
330011B111011
440100C121100
550101D131101
660110E141110
770111F151111

Reading a Hex Number

Place values are powers of 16. 1A3F is:

1×4096 + 10×256 + 3×16 + 15×1 = 6,719

Where You Meet Hex

  • Colour codes — #FF5733 is three bytes: red 255, green 87, blue 51.
  • Memory addresses — compact and aligned to byte boundaries.
  • MAC addresses — six bytes written as twelve hex digits.
  • Unicode code points — U+1F600 is the grinning face emoji.
  • Error codes and hashes — MD5 and SHA outputs are always written in hex.

Notation

Hex numbers are marked in several ways depending on context: 0x1A3F in C, JavaScript and Python; #1A3F for colours; 1A3Fh in assembly; and $1A3F in older systems. All mean the same value.

Frequently Asked Questions

Why not use octal instead?

Octal groups bits in threes, which does not divide evenly into 8-bit bytes. Hex groups in fours, so exactly two hex digits make a byte. Octal was common when word sizes were multiples of three, and survives mainly in Unix file permissions.

Is hex case sensitive?

No. 1a3f and 1A3F are identical. Uppercase is conventional for values, lowercase common in hashes and colour codes.

How do I convert hex to binary quickly?

Replace each digit with its four-bit pattern from the chart above. 1A3F becomes 0001 1010 0011 1111. No arithmetic required.