Decimal To Hex
Convert decimal numbers to hexadecimal, turning base 10 into base 16. No signup. Ideal for programmers, web developers and anyone working with hex.
Share on Social Media:
A decimal to hex converter turns an ordinary base-ten number into hexadecimal — 255 becomes ff. Enter one whole number, click Convert to Hex, and copy the lowercase hex result or save it as a TXT file. It is free, with no signup.
On this page
- How to Convert Decimal to Hex Step by Step
- What Decimal and Hexadecimal Are
- Why Hexadecimal Is Used in Computing
- Who Converts Decimal to Hex
- Pro Tips for Working With Hex
- Common Decimal to Hex Mistakes to Avoid
- Related Tools You May Need Next
- Frequently Asked Questions
How to Convert Decimal to Hex Step by Step
- Enter your decimal number. Type or paste one whole number into the box above — for example “255”. You can also upload a .txt file containing the number instead of typing.
- Click “Convert to Hex”. The tool sends your number to the server and returns the hex form.
- Read the result. The hex value appears under “Result” in lowercase, with no 0x prefix — 255 becomes ff.
- Copy or save. Click Copy to Clipboard to copy the hex, or Save as TXT to download it as decimal-to-hex.txt.
Enter one number at a time. A second number on the next line, or a number above the signed 64-bit range, returns an error page instead of a result.

What Decimal and Hexadecimal Are
Decimal is the base-ten system we use every day, with digits 0 to 9. Hexadecimal, or hex, is base sixteen: it uses the digits 0 to 9 plus the letters a to f for the values ten to fifteen. Each hex position is worth a power of sixteen — ones, sixteens, 256s — just as each decimal position is worth a power of ten.
| Decimal value | Hex digit | Why it matters |
|---|---|---|
| 10 | a | First letter digit — 10 in decimal is a in hex |
| 11 | b | |
| 12 | c | |
| 13 | d | |
| 14 | e | |
| 15 | f | Highest single hex digit |
| 16 | 10 | One sixteen and zero ones — just like 10 in decimal means one ten |
Worked example — 255 to hex: divide by 16 and keep the remainders. 255 ÷ 16 = 15 remainder 15 (f); 15 ÷ 16 = 0 remainder 15 (f). Read the remainders bottom-up: ff. Check: 15 × 16 + 15 = 255. Two more: 42 ÷ 16 = 2 remainder 10 (a), so 42 is 2a; 1000 ÷ 16 = 62 remainder 8, 62 ÷ 16 = 3 remainder 14 (e), 3 ÷ 16 = 0 remainder 3, so 1000 is 3e8.
Negative numbers: the tool converts them to their 64-bit two’s-complement form, so −5 becomes fffffffffffffffb — sixteen hex digits. That is the correct low-level representation, but if you only need ordinary positive numbers, stick to those: the tool handles whole numbers from −9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.

Why Hexadecimal Is Used in Computing
| Aspect | Decimal | Hexadecimal | Binary |
|---|---|---|---|
| Base | 10 | 16 | 2 |
| Digits | 0–9 | 0–9 and a–f | 0 and 1 |
| 255 written as | 255 | ff | 11111111 |
| 16 written as | 16 | 10 | 10000 |
| One digit covers | One of ten values | One of sixteen values | One bit |
| Where you meet it | Everyday counting | Colour codes, addresses, debugging | Machine level |
Hex is popular because sixteen is a power of two: one hex digit is exactly four binary digits, so hex is a compact, readable shorthand for binary. The colour #ff5733 is three bytes — ff (255) red, 57 (87) green, 33 (51) blue — written in six hex digits instead of twenty-four binary ones. The same value in all three forms: decimal 255, hex ff, binary 11111111.
Who Converts Decimal to Hex
Programmers. Turning ordinary numbers into the hex form used in code, flags and bit masks.
Web developers. Converting decimal colour values (like 255, 87, 51) into hex colour codes (like #ff5733).
Students. Learning number bases and checking divide-by-16 working against the tool.
People working with low-level values. Memory addresses, error codes and hardware registers are usually written in hex.
Anyone reading a hex value. Converting it back to a familiar decimal number to understand what it means.
Pro Tips for Working With Hex
Learn the six letter digits. a = 10, b = 11, c = 12, d = 13, e = 14, f = 15 — that table alone converts most small numbers by hand.
Remember the output is lowercase with no 0x. The tool gives ff, not FF or 0xff. Add the prefix yourself if your code needs it, and uppercase the letters if your style guide wants capitals.
Check all-digit results twice. 16 converts to 10, which looks like decimal ten — it is one sixteen and zero ones. Read hex results as hex, not as decimal.
Stay inside the 64-bit range. The tool handles whole numbers up to 9,223,372,036,854,775,807. Anything at or above 2^63 returns an error page.
Convert one number at a time. A second number on another line causes an error — convert each number separately.
Verify by converting back. Use Binary to Decimal or Base Converter to check a result in the other direction.
Save before you leave. The result is not stored anywhere — copy it or download the TXT file before you close the page.

Common Decimal to Hex Mistakes to Avoid
Expecting uppercase FF. This tool always returns lowercase (ff). The value is identical — only the letter case differs.
Expecting a 0x prefix. The result has none. If your code needs 0xff, add the prefix yourself.
Entering a fraction. 10.5 becomes a — the .5 is dropped silently. This tool only handles whole numbers.
Entering more than one number. Two numbers on two lines return an error page, not two answers.
Entering a huge number. Anything at or above 2^63 (9,223,372,036,854,775,808) returns an error page instead of a result.
Reading an all-digit hex result as decimal. 16 in decimal is 10 in hex — a result of “10” means sixteen, not ten.
Entering letters or mixed text. “abc” or “12abc” returns no result and no message — enter a clean whole number.
Related Tools You May Need Next
Decimal to Binary — the same number as plain binary digits. Binary to Decimal — turn binary back into a decimal number. Binary to Hex — binary groups to lowercase hex. Hex to Binary — hex back to binary digits. Base Converter — convert between binary, decimal, hex and octal in one place. Text to Hex — text characters as two-digit hex values. Text to Binary — text characters as 8-bit binary groups. Number to Words — write a number out in English words.
Frequently Asked Questions
How do I convert decimal to hex?
Enter one whole number into the box above and click “Convert to Hex”. The hex value appears under “Result” — for example, 255 becomes ff.
Is this decimal to hex converter free?
Yes. It is completely free with no account and no signup.
Why is the result lowercase?
The tool always returns lowercase hex (ff, not FF) with no 0x prefix. The value is the same — add the prefix or uppercase the letters yourself if your code needs them.
What is 255 in hex?
ff. 255 is 15 × 16 + 15, and 15 is the hex digit f, so the answer is two f’s.
What is 16 in hex?
10 — one sixteen and zero ones. Do not read it as decimal ten.
Can I convert a fraction like 10.5?
No. The tool only handles whole numbers — 10.5 becomes a (the .5 is dropped). Convert the whole-number part only.
What is the largest number I can convert?
9,223,372,036,854,775,807 (2^63 − 1). Numbers at or above 2^63 return an error page.
Why does −5 become fffffffffffffffb?
Negative numbers are shown in 64-bit two’s-complement form — the low-level representation computers use. For ordinary use, convert positive whole numbers.
Can I convert several numbers at once?
No. Enter one number per conversion — a second number on another line returns an error page.
Can I convert hex back to decimal?
Not on this page. Use Base Converter (pick Hex as the source base and Decimal as the target) or Binary to Decimal for binary.