Hex Calculator

Quick Answer

Hexadecimal is the base-16 number system used throughout computing per IEEE standards, using digits 0-9 and letters A-F, where A=10 and F=15; this calculator adds, subtracts, multiplies, and divides hex values and converts to decimal, binary, and octal.

Also searched as: hex, hex calculator

Hexadecimal Arithmetic

Result (Hex)
119
Result (Decimal)
281

Number Base Converter

Decimal
255
Hexadecimal
FF
Binary
11111111
Octal
377
Copied!

How Hexadecimal Numbers Work

Hexadecimal (hex) is a base-16 positional number system that uses sixteen distinct symbols: the digits 0-9 represent values zero through nine, and the letters A-F represent values ten through fifteen. Each position in a hex number represents a power of 16, following the same place-value principle as the decimal (base-10) system. According to the IEEE, hexadecimal notation became the standard for representing binary data in computing because each hex digit maps to exactly 4 binary bits, making it a compact and human-readable shorthand for machine-level values. Web developers, systems programmers, and network engineers use hex daily for tasks ranging from binary data manipulation to CSS color codes.

How Hex Conversion Works

To convert a hexadecimal number to decimal, multiply each digit by 16 raised to the power of its position (counting from 0 on the right), then sum the results. The formula is:

Decimal = d(n) x 16^n + d(n-1) x 16^(n-1) + ... + d(1) x 16^1 + d(0) x 16^0

Worked example: Convert hex 2F3 to decimal. 2 x 16^2 + F(15) x 16^1 + 3 x 16^0 = 2 x 256 + 15 x 16 + 3 x 1 = 512 + 240 + 3 = 755. To convert back, repeatedly divide by 16: 755 / 16 = 47 remainder 3, 47 / 16 = 2 remainder 15 (F), 2 / 16 = 0 remainder 2, reading remainders bottom-up gives 2F3.

Key Terms You Should Know

Number Base Comparison Table

The table below shows equivalent values across the four most common number bases used in computing, as defined by the ISO/IEC 9899 C standard.

Decimal Hexadecimal Binary Octal Common Use
0000000Null byte
10A101012Line feed (ASCII)
1277F01111111177Max signed 8-bit int
255FF11111111377Max unsigned 8-bit int
65535FFFF1111111111111111177777Max unsigned 16-bit int
16777215FFFFFF24 bits all 1s77777777White (#FFFFFF)

Practical Hex Conversion Examples

Example 1 — CSS color code: The color coral is defined as #FF7F50 in hex. Breaking it down: Red = FF (255), Green = 7F (127), Blue = 50 (80). Each pair of hex digits represents a color channel value from 0-255. To darken this color by 20%, multiply each channel by 0.8: Red = CC (204), Green = 66 (102), Blue = 40 (64), giving #CC6640.

Example 2 — Memory address: A 32-bit memory address 0x0040F000 in hex equals 4,255,744 in decimal. Programmers use hex because it is far more readable than the binary equivalent 00000000010000001111000000000000. Use our scientific calculator for additional computational needs.

Example 3 — Hex arithmetic: Adding hex 1A3 + 2BC: convert to decimal (419 + 700 = 1119), then back to hex = 45F. Alternatively, add column by column in base 16: 3 + C = F, A + B = 15 (write 5, carry 1), 1 + 2 + 1 = 4, result = 45F.

Tips for Working with Hexadecimal

Frequently Asked Questions

Related Calculators