Hex Calculator

0x1A3F

Hexadecimal (base 16)
Decimal (base 10)
Binary (base 2)
Octal (base 8)
Digit Place Value (16n) Decimal Contribution

How Hexadecimal Conversion Works

Hexadecimal is a base-16 positional number system using the sixteen symbols 0-9 and A-F, where A=10 through F=15. Each digit represents a power of 16, just as each digit in decimal represents a power of 10. To convert a hex number to decimal, multiply each digit by 16 raised to its position (counting from 0 on the right) and sum the results — for example, 1A3F in hex is (1 × 16³) + (10 × 16²) + (3 × 16¹) + (15 × 16⁰) = 4096 + 2560 + 48 + 15 = 6719 in decimal. Converting decimal to hex works in reverse, using repeated division by 16 and reading the remainders from last to first. Binary and octal conversions shown above use the same underlying decimal value as an intermediate step, since every base-N system represents the exact same set of quantities, just written differently.

Why Hexadecimal Is Used in Computing

Hex is popular in programming and computer science because each hex digit maps cleanly onto exactly four binary bits (a "nibble") — 1A3F in hex is precisely 0001 1010 0011 1111 in binary, with no rounding or remainder to track. This makes hex a compact, human-readable shorthand for binary data such as memory addresses, color codes (like #FF9E20), and byte values, without the long strings of 1s and 0s that raw binary requires. If you regularly work with binary bit patterns directly, the binary calculator performs the equivalent arithmetic and conversions in base 2.

Hexadecimal Arithmetic

Adding, subtracting, multiplying, and dividing hex numbers follows the same rules as decimal arithmetic — carries and borrows just happen every 16 instead of every 10. This calculator converts both operands to decimal, performs the arithmetic there (integer division and remainder for the divide operation), and converts the result back to hexadecimal, binary, and octal, since that's the most reliable way to avoid manual carry/borrow errors across digits above 9. For general base-10 arithmetic on very large numbers, see the big number calculator.

Frequently Asked Questions

How do I convert a hexadecimal number to decimal by hand?

Multiply each hex digit by 16 raised to its position, counting from 0 on the rightmost digit, then add the results. For 1A3F: (1x16^3) + (10x16^2) + (3x16^1) + (15x16^0) = 4096 + 2560 + 48 + 15 = 6719. Remember that A through F stand for the decimal values 10 through 15.

Why does one hex digit always equal 4 binary bits?

Because 16 is 2^4, every possible hex digit (0-F) corresponds to exactly one 4-bit binary pattern (0000 through 1111) with nothing left over. That clean mapping is why hex is used as a compact shorthand for binary data like memory addresses and color codes, whereas converting between decimal and binary doesn't divide evenly like that.