Hex Converter

Convert hex to decimal, binary and octal in one step. This hex converter handles very large signed whole numbers exactly.

Your inputs

Signed integers; matching 0x, 0b, and 0o prefixes are accepted. Up to 1,024 characters.

Calculated on your device. Your inputs stay with you.

A LITTLE MORE CLARITY

Decimal value

255
Hexadecimal (base 16)
FF
Binary (base 2)
11111111
Octal (base 8)
377

Results may include sensitive inputs. Review before copying or sharing.

How it works

Exact integer conversion uses BigInt, so values larger than JavaScript’s safe integer limit retain their digits. Fractional numbers are not accepted.

How to use the hex converter

Select source base and optional signed width, then enter a signed whole number; matching base prefixes are allowed.

Hex Converter formula

  1. Read the signed integer in base 2, 8, 10 or 16, then encode its exact BigInt value in each destination base.

Worked example

Hexadecimal FF is decimal 255, binary 11111111 and octal 377. Signed −1 in 8-bit two’s complement is 11111111.

Understanding your result

Every base represents the same whole number with different digits. Hexadecimal groups binary into fours, so each hex digit equals four bits, which is why it is popular for memory addresses and color codes. Two's-complement output shows how a signed value is stored in a fixed number of bits.

Frequently asked questions

Does bit width change how input is interpreted?

Input remains a signed integer, not a two’s-complement bit pattern. Width validates the signed range and adds a padded two’s-complement output.

Are fractional hexadecimal numbers supported?

No. The converter accepts signed whole integers only. Input is limited to 1,024 characters, and selected bit widths must contain the signed value.

How do I convert hex to decimal?

Multiply each hex digit by 16 raised to its position, counting from zero on the right, and add the results. FF = 15 × 16 + 15 = 255.

How do I convert decimal to hex?

Divide by 16 repeatedly and write the remainders from last to first, using A–F for 10–15. 255 gives remainders 15 and 15, so FF.

What does 0x mean before a number?

0x is a common prefix showing that a number is hexadecimal, such as 0xFF. The converter accepts matching prefixes for the selected base.

Last updated: · Reviewed by the Orizonsol team · How we build and check our calculators