Quick answer
To convert decimal to hexadecimal, divide by 16 repeatedly and read the remainders from last to first. 255 = FF in hex, 11111111 in binary and 377 in octal.
Choose the input base, enter the value and read the other bases.
Related tools: Hex Calculator: Add, subtract or multiply hexadecimal numbers. Pixels Per Inch (PPI) Calculator: Pixel density of a display. Hex to Text Converter: Decode hexadecimal bytes as UTF-8 text.
How to use the Decimal to Hex Converter
- Choose input base: Decimal (10), Binary (2), Octal (8) and Hexadecimal (16).
- Type value, for example 255 or FF.
- Press Calculate to see the result, and use Reset to start again.
| Input | What to enter | Allowed values |
|---|---|---|
| Input base | Choose one: Decimal (10); Binary (2); Octal (8); Hexadecimal (16) | Starts at Decimal (10) |
| Value | Text, such as 255 or FF | — |
Formula and method
Formula
Σ dᵢ × baseⁱ
IEEE-754 double precision; shown to at most 6 decimal places.
BigInt parsing and printing, so large integers stay exact. Non-negative integers only.
Worked examples
These examples are verified: each one is an automated test case that the live calculator must reproduce exactly.
Example 1
Inputs: Input base = Decimal (10); Value = 255.
| Result | Value |
|---|---|
| Hexadecimal | FF |
| Binary | 11111111 |
| Octal | 377 |
| Decimal | 255 |
Example 2
Inputs: Input base = Binary (2); Value = 1010.
| Result | Value |
|---|---|
| Hexadecimal | A |
| Binary | 1010 |
| Octal | 12 |
| Decimal | 10 |
Example 3
Inputs: Input base = Decimal (10); Value = 18446744073709551616.
| Result | Value |
|---|---|
| Hexadecimal | 10000000000000000 |
| Binary | 10000000000000000000000000000000000000000000000000000000000000000 |
| Octal | 2000000000000000000000 |
| Decimal | 18446744073709551616 |
The first line is the headline result (hexadecimal). Below it the decimal to Hex Converter lists binary, octal and decimal, which describe the same case from other angles. IEEE-754 double precision; shown to at most 6 decimal places.
By hand
255 ÷ 16 = 15 remainder 15, and 15 ÷ 16 = 0 remainder 15. Both remainders are 15, written F, so 255 is FF. In reverse: F × 16 + F = 255.
Where hex appears
Hex is used for colours (#FF0000), memory addresses and byte values because two hex digits describe one byte exactly.
What happens with invalid input
These messages are produced by the calculator itself, so you know what to fix.
- Value: entering "102" shows "Use only valid base-2 digits (up to 64)." beside that field and no result.
Choosing between the Decimal to Hex Converter and similar calculators
Each row shows what a related calculator on this site asks for and what it returns, so you can pick the one that matches your question.
| Calculator | You enter | It returns |
|---|---|---|
| [Hex Calculator](/technology/hex-calculator/) | first hex number, second hex number and operation | Result |
| [Pixels Per Inch (PPI) Calculator](/technology/pixels-per-inch/) | horizontal pixels, vertical pixels and diagonal size | Pixel density |
| [Hex to Text Converter](/technology/hex-to-text/) | hex bytes | Text |
| [Tip Calculator](/finance/tip-calculator/) | bill amount, tip and split between | Tip |
| [Discount Calculator](/finance/discount-calculator/) | original price and discount | Final price |
Assumptions and limitations
- Digits must be valid for the base
- Up to 64 digits
If a required value is empty, not a number, or outside its allowed range, the form marks that field with a message and shows no result instead of a misleading number. The automated checks deliberately try invalid entries for value to confirm this.
Frequently asked questions
What is 100 in hex?
100 in decimal is 64 in hexadecimal (6 × 16 + 4).
How do I read A to F?
The letters A to F stand for 10 to 15 in hexadecimal digits.
Is 0x prefix needed?
No. Enter the digits only; 0x is a programming-language prefix, not part of the value.
What does the Decimal to Hex Converter calculate?
Convert integers between binary, octal, decimal and hexadecimal. It returns Hexadecimal, Binary, Octal and Decimal.
What formula does the Decimal to Hex Converter use?
Σ dᵢ × baseⁱ. BigInt parsing and printing, so large integers stay exact.
What do I need to enter in the decimal to Hex Converter?
You enter Input base and Value.
How is the result rounded or limited?
IEEE-754 double precision; shown to at most 6 decimal places. Digits must be valid for the base.
What are the limits of this converter?
Digits must be valid for the base. Up to 64 digits.
What does the “Input base” option change?
It sets how the decimal to Hex is worked out. The choices are Decimal (10), Binary (2), Octal (8) and Hexadecimal (16).
What is an example of a decimal to Hex result?
With input base Decimal (10) and value 255, the hexadecimal is FF.
Related calculators
- Hex Calculator — Add, subtract or multiply hexadecimal numbers.
- Pixels Per Inch (PPI) Calculator — Pixel density of a display.
- Hex to Text Converter — Decode hexadecimal bytes as UTF-8 text.
Sources
- OpenStax, University Physics Volume 1 (Rice University): mechanics
Content last reviewed 2026-11-04. Formulas and worked examples are checked by automated tests against independently computed values.