Hex Calculator
Perform hexadecimal arithmetic and convert between hex, binary and decimal. Hex is commonly used in programming, color codes and memory addresses.
How to use the Hex Calculator
- Enter your inputs into the Hex Calculator above.
- Results update instantly as you type — no submit button needed.
- Adjust any value to see how the result changes in real time.
The hex conversion
Hex to decimal: Σ (digit × 16^position) · · · Hex digits: 0–9, A=10, B=11, C=12, D=13, E=14, F=15
Hex is base-16. Each hex digit represents 4 binary bits, making conversion to binary trivial. Hex is the standard "human-readable" representation of binary data in programming.
Worked example
Hex FF to decimal: 15×16 + 15 = 255. Hex 1A3F: 1×4096 + 10×256 + 3×16 + 15 = 6,719 decimal. Color code #4A90E2 in hex is RGB(74, 144, 226) — that's 74 red, 144 green, 226 blue.
Frequently asked questions
Why use hex over binary?
A 32-bit number takes 32 binary digits but only 8 hex digits. Hex is much more compact and easier to read while preserving the bit-level structure (each hex digit maps to 4 specific bits).
What's the 0x prefix?
A common notation to indicate a hex value. 0xFF means hex FF = 255 decimal. Languages like C, Python and JavaScript all use 0x prefix.
How do hex colors work?
Six-digit hex colors represent RGB: first 2 digits red (00–FF), next 2 green, last 2 blue. #FF0000 = pure red, #00FF00 = pure green, #FFFFFF = white.