Skip to content

Decimal to Hex

Convert decimal to hexadecimal.

Input
Output

No result

About Decimal to Hex

Converting a decimal number to hexadecimal expresses it in base 16, using 0–9 together with A–F for the values ten through fifteen. The reason this notation is everywhere in computing is alignment: two hex digits describe exactly one byte, so 255 becomes FF and 4096 becomes 1000 — a mapping that is easy to read at a glance.

As with the other base conversions here, input is taken as a list of tokens separated by spaces or commas and each is converted independently. That suits the way hex actually appears in practice, which is almost always in columns — colour tables, memory addresses, character code charts.

One note on letters: the output uses uppercase A–F, which is the convention in specifications, while many programming environments print lowercase. The two are the same value, and tools that read hex accept either, so nothing breaks if you need lowercase downstream.

How to use Decimal to Hex

  1. 1 Enter one or more decimal numbers, separated by spaces or commas.
  2. 2 Each value is converted to hexadecimal and shown immediately.
  3. 3 Copy the result — letters are uppercase, as they are in most specifications.

Frequently asked questions

Why does hexadecimal use letters at all?

Because base 16 needs sixteen distinct symbols and the decimal digits only provide ten. The letters A through F supply the remaining six values, representing ten to fifteen, so that every value the nibble range can hold has a single-character symbol.

Where would I actually use this?

Most often for colour values, where a colour is stored as three or four bytes and written as hex — #FF8800 rather than its decimal triplet. It also shows up in memory addresses, character code charts, and any place where byte alignment matters more than readability to a human.

Is the output uppercase or lowercase?

Uppercase, following the convention used in specifications and most written documentation. Lowercase is equally valid and is what many programming languages print by default — if your target expects lowercase, convert the case after copying.

Can it handle negative numbers?

The conversion operates on integer values and does not use a fixed bit width, so it is designed for the non-negative values you would normally write in hex. Signed representations such as two's complement are a separate topic.

Free, online, and private

Free to use

Decimal to Hex is completely free. There is no account to create, no login, and no hidden charge or usage limit.

Runs online in your browser

It is a free online tool that runs entirely in your browser. Nothing to download or install — open the page and start using it right away.

Your data stays private

All processing happens locally on your device. Your input is never uploaded, stored, or tracked, so it never leaves your browser.

How Decimal to Hex behaves in detail

These are the specifics of this implementation — the exact ranges, defaults and fixed settings you are working with.

Parameter Value
Tokenizer split on runs of whitespace or commas
Digit parsing parseInt with radix 10
Output case lowercase hex digits
Prefix none — no 0x is added to any value
Zero padding none, so 15 is answered as f rather than 0f

Compiled from the implementation of this tool and checked against it by itoolnet.

What Decimal to Hex does not do

Knowing the edges of a tool saves more time than another list of its features. These are the cases where it will not do what you might expect.

  • Output carries no prefix and no byte padding, so it is not a C-style literal and cannot be concatenated straight into a longer hex string — 15 arriving as f would corrupt a byte-aligned sequence built from these pieces.
  • Only integers survive the parse. A decimal point cuts the token short and an exponent is ignored, while a token the parser cannot read at all is echoed back untouched, so converted values and unparsed junk end up mixed in one line of output.
  • The conversion happens in JavaScript number arithmetic, so inputs beyond 2^53 are rounded before they are converted and the hex shown is an approximation of the value that was typed.

Tested and documented by itoolnet, the team that builds and maintains this site.

Share & embed this tool

Writing a guide or article? You are welcome to link to Decimal to Hex with the snippet below. It is free, runs entirely in your browser, and needs no signup.