The problem: you keep seeing 0x and letters where numbers should be
Hexadecimal shows up in color codes (#FF5733), memory addresses (0x7FFF), MAC addresses, IPv6, byte values in hex editors, and debug output. If you work with computers at any level below a browser, you will encounter hex. The problem is that hex mixes digits 0-9 with letters A-F and prefixes like 0x, which makes it look like it requires a different kind of math. It does not. Hexadecimal is a base-16 positional number system, and the conversion to decimal uses the same formula you learned in grade school for base-10: each digit has a place value, you multiply, you add.
The tool converts between hexadecimal, decimal, binary, and octal in either direction, with step-by-step positional breakdowns and BigInt support for arbitrarily large numbers. Understanding positional notation is the only concept you need.
Fastest path
Open the Hex to Decimal Converter, pick the conversion direction (eight tabs covering hex, decimal, binary, and octal in both directions), type your value, and read the result. The tool auto-strips 0x, 0b, and 0o prefixes. For hex-to-decimal and similar to-decimal conversions, the Steps panel shows the positional breakdown — each digit's value, place value, and subtotal. The All Bases card shows the same number in all four bases at once.
Positional notation: the one formula
Every integer in any base is a sum of digits times place values. The place value for position i (counting from right, starting at 0) is base^i. In decimal (base 10):
327 = 3×10² + 2×10¹ + 7×10⁰
= 3×100 + 2×10 + 7×1
= 300 + 20 + 7 = 327
The same formula applies to any base. In hexadecimal (base 16):
ABC = A×16² + B×16¹ + C×16⁰
= 10×256 + 11×16 + 12×1
= 2560 + 176 + 12 = 2748
The only difference is the base (16 instead of 10) and the digit values. Hex digits 0-9 have their face value (0 through 9). Hex digits A-F have values 10 through 15: A=10, B=11, C=12, D=13, E=14, F=15. That is the entire mapping. There is nothing else to memorize.
The tool's step-by-step panel renders this exact computation as a table: one row per digit, showing the digit, its numeric value, its position (16^0, 16^1, 16^2...), the place value (1, 16, 256...), and the subtotal (digit value times place value). The total at the bottom is the decimal result.
Converting decimal to hex: repeated division
The reverse direction — decimal to hex — uses a different algorithm: repeated division by 16, collecting remainders. Each remainder becomes one hex digit, read from bottom to top.
2748 ÷ 16 = 171 remainder 12 → C
171 ÷ 16 = 10 remainder 11 → B
10 ÷ 16 = 0 remainder 10 → A
Read bottom-up: ABC
The tool handles this internally. When you use the Dec to Hex tab, it performs this division loop and assembles the hex digits. The same algorithm works for any target base: divide by 2 for binary, by 8 for octal, by 16 for hex.
Why hex exists: the nibble shortcut
Hexadecimal is not an arbitrary choice of base. It exists because 16 is a power of 2, specifically 2^4. This means each hex digit corresponds to exactly 4 binary digits (a nibble), and the mapping is fixed:
0 = 0000 4 = 0100 8 = 1000 C = 1100
1 = 0001 5 = 0101 9 = 1001 D = 1101
2 = 0010 6 = 0110 A = 1010 E = 1110
3 = 0011 7 = 0111 B = 1011 F = 1111
To convert hex to binary, replace each hex digit with its 4-bit equivalent. FF becomes 11111111. A5 becomes 10100101. No arithmetic needed — it is a lookup table. To convert binary to hex, group the binary digits into groups of 4 from the right, then replace each group with its hex digit. 11010110 becomes 1101 0110 becomes D6.
This is why hex won over octal (base 8) in computing. Octal groups 3 binary digits, which aligns with 12-bit and 24-bit architectures. When byte-addressable 8-bit, 16-bit, and 32-bit systems became standard, hex's 4-bit grouping fit perfectly — a byte is exactly 2 hex digits. Octal does not divide evenly into a byte (8 bits / 3 = 2 groups with 2 bits left over). Hex does (8 bits / 4 = 2 groups, no remainder).
Where hex actually appears
Color codes. #FF5733 is three bytes: FF (red), 57 (green), 33 (blue). Each byte is 2 hex digits, giving 256 values per channel. The tool converts each pair from hex to decimal if you need the RGB values: FF = 255, 57 = 87, 33 = 51.
Memory addresses. Debuggers, profilers, and crash logs print memory addresses in hex. 0x7FFF6A8B4C00 is easier to read than 140735,000,000,000 in decimal, and it aligns with the 4-byte or 8-byte structure of the address space.
Byte values. Hex editors display file contents as hex pairs. The byte FF (255) is the maximum unsigned byte value. The byte 00 is zero. A file containing the bytes 89 50 4E 47 is a PNG file — the magic number header, read as hex, identifies the format.
MAC addresses and IPv6. Network hardware addresses are 6 bytes written as hex pairs (00:1A:2B:3C:4D:5E). IPv6 addresses are 128 bits written as 8 groups of 4 hex digits (2001:0DB8:0000:0000:0000:0000:0000:0001).
BigInt: why the tool does not overflow
JavaScript's Number type stores integers as 64-bit floating point, which gives exactly 53 bits of integer precision — about 9 quadrillion (9,007,199,254,740,991). A 14-digit hex number like 0x20000000000000 exceeds this. The tool uses BigInt, JavaScript's arbitrary-precision integer type, which has no size limit. Conversions involving hex strings longer than 13 digits will produce correct decimal results because BigInt arithmetic does not lose precision. Standard Number-based conversion (parseInt('0x' + hex, 16)) silently rounds large values — the tool avoids this entirely.
Gotchas
- Letters are case-insensitive, but conventions vary. The tool accepts both upper and lowercase (FF and ff are the same number). Programming conventions differ: C and Java use uppercase (0xFF), HTML colors use uppercase (#FF5733), URL encoding uses uppercase (%0A). The tool's uppercase toggle controls output format, not input parsing.
- The 0x prefix is a convention, not part of the number. 0xFF and FF are the same value. The tool auto-strips 0x, 0b, and 0o prefixes. If you paste a value with a prefix, it is removed before conversion. If your value has no prefix, it is treated as-is.
- Negative numbers are not handled. The tool converts unsigned values only. Hex representations of negative numbers use two's complement, which depends on the bit width — -1 in 8-bit two's complement is FF, but in 16-bit it is FFFF. The tool does not know your bit width, so it treats all input as unsigned. For negative number conversion, you need to know the signed representation and bit width yourself.
- Leading zeros do not change the value. 0x00FF and 0xFF are both 255. But leading zeros matter in some contexts: a hex color code must have exactly 6 digits (00FF57 is valid, FF57 is not a valid color code). The tool does not pad output to a specific width.
- Octal is increasingly rare. The tool includes octal conversion, but octal is mostly historical. Unix file permissions (chmod 755) are the last common use of octal in modern computing. If you are not working with Unix permissions, you will likely never need octal.
Summary
- Hex to decimal uses positional notation: each digit times its place value (16^position), summed. Hex digits A-F map to values 10-15. The formula is identical to decimal, just with base 16 instead of base 10.
- Decimal to hex uses repeated division by 16, collecting remainders from bottom to top.
- Hex exists because 16 = 2^4, so each hex digit maps to exactly 4 binary digits (a nibble). A byte is 2 hex digits. This is why hex replaced octal in modern computing.
- The tool uses BigInt for arbitrary precision, avoiding JavaScript's 53-bit Number limit. It handles only unsigned values — negative numbers in hex require two's complement and a known bit width.
- Use the Hex to Decimal Converter for the conversion with step-by-step breakdown, the Number Base Converter for general base conversions, the Byte Converter for data storage unit conversions, and the Unix Timestamp Converter for timestamp conversions.