Skip to content
CalculatorBuddy

Hex to Decimal Converter

Convert hexadecimal to decimal or decimal to hexadecimal exactly, including large signed integers. Also see binary, octal, and place-value steps.

Maintained by Pruthvirajsinh ZalaEditorial methodology

ExampleSample values — edit any field to see your result.

Digits 0–9 and A–F; an optional sign or 0x prefix is accepted. Up to 256 digits.

Results update as you type.

Decimal (base 10)

255

Estimated result

Hexadecimal (base 16)
FF
Binary (base 2)
11111111
Octal (base 8)
377
Magnitude bit length
8
Sign convention
A minus sign denotes a negative magnitude. These are not fixed-width two’s-complement encodings.

Saved calculations stay only in this browser. Share copies a link containing your entered values.

Compare scenarios

Keep a baseline, then change an assumption to see its effect side by side.

Hexadecimal place values (magnitude)

DigitPowerDecimal contribution
F16^1240
F16^015

Convert a whole number between hexadecimal and decimal, and inspect its binary and octal equivalents. The place-value table explains how the hexadecimal digits contribute to the decimal magnitude.

How to enter a number

Choose Hex to decimal and enter digits such as FF, 0x2A, or -80. Choose Decimal to hex for an integer such as 255 or -128. A leading plus or minus sign is allowed. Use at most 256 digits and omit commas, spaces inside the number, and decimal points.

Leading zeros do not change the value and are removed from the result. Hexadecimal output uses uppercase letters. Zero has a displayed magnitude bit length of one.

Understanding the outputs

Each output represents the same signed integer in a different base. Decimal uses ten symbols, hexadecimal sixteen, binary two, and octal eight. The bit length counts digits needed to represent the absolute value in binary; it is not a signed storage-width recommendation.

The place-value table expands the hexadecimal magnitude from its highest power of sixteen to its lowest. For a negative number, sum those positive contributions, then apply the minus sign to the total.

Examples

Convert hexadecimal 2AF

2AF means 2 × 16² + 10 × 16¹ + 15 × 16⁰. The contributions are 512, 160, and 15, so the decimal result is 687. Its binary representation is 1010101111.

Convert decimal 255

255 is FF in hexadecimal, 11111111 in binary, and 377 in octal. The magnitude needs eight binary digits. Adding a minus sign gives −255, represented here as −FF.

Formula

For hexadecimal digits d at positions k, with the rightmost position numbered zero:

Decimal magnitude = sum of (digit value × 16^position)
A = 10, B = 11, C = 12, D = 13, E = 14, F = 15

To convert decimal to hexadecimal by hand, repeatedly divide the magnitude by 16 and read the remainders in reverse order.

Signed values and computer storage

A stored bit pattern only has a signed interpretation when its width and encoding are specified. This tool uses a written minus sign, not two’s complement, and does not pad to 8, 16, 32, or 64 bits. It also does not interpret byte order, text encodings, or color channels.

For a memory value, check the program's data type and width before interpreting a high hexadecimal digit as a negative sign.

Frequently asked questions

Which hexadecimal digits are valid?
Hexadecimal uses 0 through 9 and A through F, where A is 10 and F is 15. Uppercase and lowercase letters are accepted, as is an optional 0x prefix.
Can this convert large integers exactly?
Yes. Integer conversion uses arbitrary-precision arithmetic, supporting up to 256 input digits. It does not round through a floating-point number.
Does FF mean −1?
Here FF means positive 255. Interpreting FF as −1 requires an explicit 8-bit signed two’s-complement convention, which this converter does not apply. Enter −FF to represent negative 255.
Can I convert hexadecimal fractions?
No. These modes accept whole signed integers only. Decimal points, separators, and fractional hexadecimal values are rejected.

Related calculators