Our methodology
The formulas, rules and tests behind every tool on the site.
How the tools work
Hex to decimal uses place value. Each digit is multiplied by 16 raised to its position, counted from 0 on the right, and the products are added: decimal = dₙ × 16ⁿ + … + d₁ × 16 + d₀.
Decimal to hex reverses it: divide by 16, keep the remainder as the next digit, and repeat until the quotient is 0. Signed values use two's complement: if the top bit is set, subtract 2ⁿ, where n is the bit width.
The tools do this with JavaScript BigInt, which stores whole numbers of any size exactly. Floating point is used only on the hex to float page, where IEEE 754 is the subject.
Inputs and limits
The converters accept 0-9 and A-F in either case. They ignore spaces, underscores and commas, plus a leading 0x or # and a trailing h. Any other character shows an error instead of a guess.
The main converter takes up to 64 hex digits (256 bits) and whole numbers only. Decimal to hex accepts fractions and stops after 16 hex places, marking the result as rounded. The code pages model each language's own limits, such as Java's 32-bit int or Excel's 10-digit HEX2DEC.
How we test
Every tool is checked against known values before release and after each change: 0, F = 15, FF = 255, 100 = 256, FFFF = 65,535, 7FFFFFFF = 2,147,483,647, FFFFFFFF = 4,294,967,295 and 2²⁵⁶ − 1. Signed results are checked at 8, 16, 32 and 64 bits, including 80, 8000 and 80000000.
Float results are compared with the IEEE 754 values for 1.0 (3F800000), π (40490FDB) and the special values. Code page outputs follow each language's documentation.
Runs in your browser
Every tool runs on your device. Nothing you type reaches our server.