toolqik

91 · Encode & Convert

Hex to Decimal

Convert hexadecimal numbers (0xFF, #7C3AED) to decimal, any size, signed or unsigned.

Runs in your browser
Format
Result

  

About this tool

Convert hexadecimal (base 16) numbers to decimal. Paste one per line in any common notation: FF, 0xFF, #FF or FFh. Values of any size convert exactly, including 64-bit IDs and hashes that a normal calculator would round.

How to convert hex to decimal

Hex digits go from 0 to 15, written 0–9 then A–F (A = 10 … F = 15). Each position is worth 16 times the one to its right:

0x1F4  =  1×256 + 15×16 + 4×1  =  256 + 240 + 4  =  500
0xFF   =  15×16 + 15           =  255

Colour codes

A CSS colour like #7C3AED is three hex bytes: red 7C = 124, green 3A = 58, blue ED = 237. Enter each pair on its own line to get the RGB values, or use the colour converter for all colour formats.

Signed values

Hex dumps and registers often hold signed integers. FFFFFFFF is 4,294,967,295 unsigned but −1 as a signed 32-bit integer. Choose the bit width under Negative numbers (each hex digit is 4 bits, so 8 hex digits = 32 bits) to read it as two’s complement.

Features

  • Any size: numbers are converted exactly with arbitrary-precision arithmetic, so 64-bit values and even longer numbers never lose digits (a normal calculator rounds anything above 253).
  • Fractions: 3.75 → 11.11. Fractions that don’t end in the target base, like 0.1 in binary, are cut off after the chosen number of digits and marked with ….
  • Negative numbers with a minus sign, or as two’s complement in 8, 16, 32 or 64 bits, the way computers store signed integers.
  • Flexible input: prefixes (0b, 0o, 0x, #), spaces, underscores and thousands separators are ignored. Convert many numbers at once, one per line.
  • The first number is also shown in every base, with the number of bits it needs.

Quick reference

DecimalBinaryOctalHex
0000
1111
21022
31133
410044
510155
711177
81000108
91001119
10101012A
15111117F
16100002010
321000004020
64100000010040
100110010014464
12711111111777F
1281000000020080
25511111111377FF
256100000000400100
1024100000000002000400

FAQ

How do I convert hex to decimal?

Enter the hex number (with or without 0x) and the decimal value appears. By hand, multiply each digit by a power of 16 and add the results.

What is FF in decimal?

255. 100 in hex is 256, and FFFF is 65,535.

What do the letters A–F mean in hex?

They are the digits 10 to 15: A = 10, B = 11, C = 12, D = 13, E = 14, F = 15.

How do I convert a negative hex number?

Choose the bit width under Negative numbers. FFFFFFFF in 32-bit two’s complement is −1, and FF in 8 bits is −1.

Can it convert very large hex numbers?

Yes, exactly, at any length. 0xFFFFFFFFFFFFFFFF converts to 18446744073709551615 without rounding.

esc
↑↓ navigate↵ open