Skip to content

Hex Calculator

Hex arithmetic (add, subtract, multiply, divide) and conversions between hexadecimal, decimal, binary, and octal.

Hex Arithmetic

= E23

Decimal: 1,015 + 2,604 = 3,619

Hex to Decimal / Binary / Octal

Hex:
Decimal48,879
Binary1011111011101111
Octal137357

Decimal to Hex / Binary / Octal

Decimal:
HexadecimalFF
Binary11111111
Octal377

Hexadecimal Number System

Hexadecimal (base-16) is a compact way to represent binary data. Each hex digit maps to exactly 4 binary bits, making conversions between hex and binary straightforward. One byte (8 bits) is always two hex digits.

Hex Digits

HexDecimalBinary
000000
110001
220010
330011
440100
550101
660110
770111
881000
991001
A101010
B111011
C121100
D131101
E141110
F151111

Hex Arithmetic

Hex arithmetic works exactly like decimal arithmetic but in base 16. You can add, subtract, multiply, and divide hexadecimal numbers. The calculator converts to decimal internally, performs the operation, and converts back.

Examples

  • 3F7 + A2C = E23 (1015 + 2604 = 3619)
  • FF × 2 = 1FE (255 × 2 = 510)
  • 100 − 1 = FF (256 − 1 = 255)

Common Hex Values

HexDecimalSignificance
FF255Max unsigned byte
FFFF65,535Max unsigned 16-bit
FFFFFFFF4,294,967,295Max unsigned 32-bit
7F127Max signed byte
80128High bit set (byte)
DEADBEEF3,735,928,559Common debug marker

Hex in Web Development

CSS color codes use hexadecimal: #RRGGBB where each pair is 00-FF (0-255). For example, #FF0000 is pure red (R=255, G=0, B=0), and #808080 is medium gray (128, 128, 128).

Related Calculators

Frequently Asked Questions

What is hexadecimal?

Hexadecimal (base-16) uses digits 0-9 and letters A-F. Each hex digit represents 4 binary bits. It is widely used in computing for memory addresses, color codes, and data representation.

How do I convert hex to decimal?

Multiply each digit by 16 raised to its position (right to left, starting at 0). For example, 2F = 2×16¹ + 15×16⁰ = 32 + 15 = 47.

How do I convert decimal to hex?

Repeatedly divide by 16 and note the remainders. Read remainders bottom-up. For 255: 255÷16 = 15 R15, 15÷16 = 0 R15. Remainders = F, F → FF.

What do hex letters A-F mean?

A=10, B=11, C=12, D=13, E=14, F=15. These extend the single-digit range beyond 9 to represent values 10-15 in one character.

Where is hex used?

CSS colors (#FF5733), memory addresses (0x7FFF), MAC addresses, Unicode code points, assembly language, file signatures (magic bytes), and error codes.

Is hex case-sensitive?

No. FF, ff, and Ff all represent the same value (255). Convention varies: CSS uses lowercase (#ff5733), addresses use uppercase (0x7FFF). This calculator accepts either and outputs uppercase.