Hex Calculator

Perform arithmetic operations on hexadecimal numbers and convert between hex and decimal values.

Hexadecimal arithmetic

Convert hex to decimal

Convert decimal to hex

How hexadecimal (base-16) numbers work

Hexadecimal uses 16 digits — 0 through 9, then A through F to represent 10 through 15 — with each position representing a power of 16. It's widely used in programming and computing because it maps neatly onto binary: each hex digit corresponds to exactly 4 binary bits, making it a compact, human-readable shorthand for binary data like memory addresses and color codes.

Frequently asked questions

Why is hex used for things like color codes? A color like #FF5733 packs three byte values (red, green, blue, each 0–255) into six hex digits — far more compact than writing out the equivalent binary or decimal values, while still mapping cleanly to the underlying byte data.

How do I read a hex number like FF? F represents 15, and with two digits, FF = (15×16) + 15 = 255 in decimal — the maximum value representable by a single byte (8 bits).

Is hex arithmetic different from decimal arithmetic? The underlying math is the same — this calculator converts hex to decimal, performs the operation, and converts back to hex — but manual hex arithmetic requires carrying/borrowing in base 16 rather than base 10, which takes practice to do by hand.