🌐 EN

🔢 Hexadecimal Calculator

A calculator for converting between hexadecimal and decimal numbers and performing hexadecimal arithmetic operations.

Decimal Input → Hexadecimal

Hexadecimal

Hexadecimal Input → Decimal

Decimal

Hexadecimal Operations

Result
Decimal
GUIDE

Learn more

01

What is Hexadecimal?

Hexadecimal is a number system that uses 16 symbols: 0-9 and A-F, where A=10, B=11, C=12, D=13, E=14, F=15. It is widely used in web color codes (#FF0000), memory addresses, MAC addresses, etc. Four binary digits can be simply expressed as one hexadecimal digit, making it very efficient.

02

How to Convert Hexadecimal to Decimal

To convert hexadecimal to decimal, multiply each digit by powers of 16 and sum them. For example, hex 2F is (2×16¹)+(15×16⁰) = 32+15 = 47 (decimal). Hex FF is (15×16¹)+(15×16⁰) = 240+15 = 255. This calculator performs conversions automatically.

03

How to Convert Decimal to Hexadecimal

To convert decimal to hexadecimal, repeatedly divide the decimal number by 16 and read the remainders in reverse order. For example, converting decimal 255: 255÷16=15 remainder 15(F), 15÷16=0 remainder 15(F), reading in reverse gives FF. Decimal 100 is 64 in hex.

04

Web Color Codes and Hexadecimal

In HTML and CSS, colors are expressed in hexadecimal. In the #RRGGBB format, RR is red (00-FF), GG is green (00-FF), BB is blue (00-FF). Examples: #FF0000 is red, #00FF00 is green, #0000FF is blue, #FFFFFF is white, #000000 is black. Each color channel has a range of 0-255 (decimal).

05

Applications of Hexadecimal Operations

Hexadecimal operations are used in programming for bit masking, memory address calculations, and network packet analysis. For example, bit AND operations can extract specific bits, and OR operations can set bits. Hexadecimal is also essential when analyzing memory dumps during debugging.

06

Real-World Applications of Hexadecimal

Hexadecimal is widely used in web design (color codes), MAC addresses (00:1A:2B:3C:4D:5E), IPv6 addresses, file signatures (magic numbers), QR codes, encryption keys, Unicode character codes (U+0041), etc. You can also check hex color codes when using color pickers in developer tools.

Frequently asked questions

What does the 0x prefix mean in hexadecimal?
0x is a prefix commonly used in programming languages to indicate the following digits are hexadecimal. For example, 0xFF represents decimal 255; you can type just FF into this calculator without the 0x prefix.
How do I read A through F in hexadecimal?
A through F represent the values 10 through 15 and can be used in either uppercase or lowercase (a = A = 10). This calculator handles both cases automatically.
How are negative hexadecimal numbers represented?
Hexadecimal itself does not directly express negative numbers, but computer systems typically use two's complement to represent them. This calculator focuses on positive-integer conversion and basic arithmetic.
What happens if hex subtraction produces a negative result?
If the first value is smaller than the second, the result is negative. The calculator displays this as a minus sign followed by the hexadecimal absolute value.
Why does entering a color code show a preview?
A 6-digit hex value in #RRGGBB format is split into three 2-digit pairs for red, green, and blue, letting you preview the actual color. This is handy for checking web color codes visually.