Hex Calculator

Enter a hexadecimal value to convert it to decimal, binary, and octal. If you enter 6 hex digits, RGB color values are also shown. Or switch to arithmetic mode to add, subtract, multiply or divide hex numbers.

How to use this calculator

  1. For conversion: enter any hexadecimal string (0-9, A-F). Add # or 0x prefix — it is removed automatically.
  2. A 6-digit hex code (e.g. FF8C00) also shows the equivalent RGB color values.
  3. For arithmetic: enter two hex values and select the operation.

Formula & method

Hexadecimal positional notation

Decimal = Σ hex_digit_i × 16^i (from right, i = 0)

A=10, B=11, C=12, D=13, E=14, F=15.

Example

1A3F₁₆ = 1×4096 + 10×256 + 3×16 + 15 = 4096 + 2560 + 48 + 15 = 6719₁₀.

Key insights

How to interpret your result

Hex to decimal

Each digit's value is multiplied by 16 raised to its position: 1A3F = 1×16³ + 10×16² + 3×16 + 15 = 6719.

RGB colors

For 6-digit hex codes, the first two digits are red, the middle two are green, and the last two are blue, each ranging from 00 (0) to FF (255).

Frequently asked questions

What is hexadecimal?
Base-16 notation using digits 0-9 and letters A-F. 1 hex digit represents 4 binary bits.
How do I convert hex to decimal?
Multiply each hex digit by 16 raised to its position (0 from the right) and sum. 2A₁₆ = 2×16 + 10 = 42₁₀.
What does a hex color code mean?
A 6-digit hex color like #FF5733 encodes RGB values: FF=255 red, 57=87 green, 33=51 blue.

Related calculators

See all math calculators · Explore all online calculators