Decimal to hex converter

Type a whole decimal number and get its hexadecimal form straight away, in capital letters. Large values stay exact, and grouping can make long results easier to read.

  • Free
  • No sign-up
  • Runs in your browser

Hexadecimal (16)

FF

The same number in common bases
BaseValue
Binary (2)11111111
Octal (8)377
Decimal (10)255
Hexadecimal (16)FF

Whole numbers of any size are converted exactly (up to 5,000 digits). Prefixes 0x, 0b and 0o, spaces, underscores and a leading minus sign are accepted. Fractions are not supported.

Runs in your browser — your text is never sent to our servers.

How to use Decimal to Hex

  1. Type your decimal number, for example 255. A leading minus sign is allowed.
  2. Read the hexadecimal value in the result box.
  3. Tick "Group digits" to split long results into blocks of four.
  4. Click Copy to copy the hex value.

Features

  • Exact for large whole numbers, beyond 64 bits
  • Hex output in capital letters
  • Optional grouping of digits in blocks of four
  • Also shows the value in binary and octal
  • Runs in your browser, so nothing is uploaded

Supported formats and limits

  • Maximum input: 10,000,000 characters

Examples

InputResult
255FF
40961000
3735928559DEADBEEF
-255-FF — The minus sign is kept.

Limitations

  • Only whole numbers are supported; decimals such as 0.5 are not converted.
  • Negative numbers get a minus sign, not a two’s complement representation.
  • The 0x prefix is not added to the output; add it yourself if your code needs it.

Learn more

Converting decimal to hexadecimal means rewriting a number in base 16, where the digits are 0–9 and A–F. The hand method is repeated division by 16: each division leaves a remainder between 0 and 15, and the remainders read from last to first are the hex digits. For 255, dividing by 16 gives 15 remainder 15, and 15 is F, so the result is FF.

Hex is popular in computing because a byte always fits in exactly two hex digits (00 to FF), which makes long binary values compact and easy to compare. You meet it in color codes, memory addresses, character codes, hashes and network identifiers.

Many programming languages write hex literals with a 0x prefix, for example 0xFF. The prefix is notation for the compiler, not part of the number, so this converter leaves it out. Exact integer arithmetic is used, so a value like 3735928559 converts to DEADBEEF without any rounding.

Frequently asked questions

How do I convert decimal to hex by hand?

Divide the number by 16 repeatedly and note each remainder, writing 10 to 15 as A to F. Read the remainders from last to first. For 255: remainders 15 and 15, so FF.

Is the output upper or lower case?

Capital letters. Hex is case-insensitive, so you can lowercase it if your code prefers that.

How do I get a color code from decimal values?

Convert each red, green and blue value (0–255) separately and join them as two digits each. For a full picker use the RGB to HEX converter.

Is my input uploaded?

No. The conversion runs in your browser.

Sources

Last reviewed: September 30, 2026