Decimal to Hex Converter
Convert decimal to hexadecimal online with the division by 16 shown step by step. Choose uppercase, a 0x prefix and a bit width for negative numbers.
Runs in your browser · Nothing uploaded · No sign-up
Something not working, or missing a feature? Send feedback
About the Decimal to Hex Converter
The Decimal to Hex Converter writes decimal numbers in hexadecimal by dividing by 16 and reading the remainders upwards, with every step shown. Pick upper or lower case, add a 0x prefix, and choose a bit width to pad the result or to write negative numbers in two's complement, as in C and assembly.
Conversion happens in your browser, so your files and records stay private.
How to use the Decimal to Hex Converter
- Type a decimal number such as 255, or paste one per line.
- Choose uppercase or lowercase digits and whether to add the 0x prefix.
- Select a bit width (8, 16, 32 or 64) to pad with zeros or to convert negative numbers.
- Read the hex result and the division-by-16 table, then copy it.
Common values in hex
| Decimal | Hex | What it is |
|---|---|---|
| 255 | FF | Largest byte value |
| 256 | 100 | Number of values in a byte |
| 1,024 | 400 | 1 KiB |
| 4,095 | FFF | Largest 12-bit value |
| 65,535 | FFFF | Largest 16-bit unsigned value |
| 2,147,483,647 | 7FFFFFFF | Largest signed 32-bit integer |
| 4,294,967,295 | FFFFFFFF | Largest unsigned 32-bit integer |
Examples
Input
255
Result
FF
Input
3735928559
Result
DEADBEEF
Input
-1 (Bit width 32-bit)
Result
FFFFFFFF
Input
1000000
Result
F4240
Common mistakes
- Writing a remainder of 10–15 as two digits. A remainder of 12 is the single digit C, not "12". Each remainder becomes exactly one hex digit.
- Values that do not fit the width. 256 does not fit in 8 bits. The converter shows the allowed range instead of silently cutting off the high bits.
Works well with the Decimal to Hex Converter
- Hex to Decimal Converter: check the result by converting it back.
- Decimal to Binary Converter: see the same value as bits.
- Text to Hex: encode text, not numbers, as hex bytes.
Frequently asked questions
How do you convert decimal to hex?
Divide by 16 and note the remainder (0–15, with 10–15 written A–F). Repeat with the quotient until it is 0, then read the remainders from the last to the first. 255 ÷ 16 = 15 r15, 15 ÷ 16 = 0 r15, so 255 is FF.
What is −1 in hex?
It depends on the width: FF in 8 bits, FFFF in 16, FFFFFFFF in 32 and FFFFFFFFFFFFFFFF in 64. Choose the width to get the two's complement pattern.
Uppercase or lowercase?
Both are correct. Uppercase is common in documentation and dumps, lowercase in CSS colours and most programming languages' output. The value is the same.
Why do programmers use hex?
Each hex digit is exactly 4 bits, so a byte is two digits and a 32-bit value is eight. Addresses, colours, hashes and bit masks are much easier to read in hex than in decimal or binary.
Related tools
JSON to CSV
Convert JSON arrays to CSV online with automatic column detection, nested object flattening and custom delimiters. Open the result in Excel or Sheets.
CSV to JSON
Convert CSV to a JSON array online with header detection, type inference and delimiter auto-detection. Turn spreadsheet exports into data for APIs and code.
JSON to XML
Convert JSON to well-formed XML online with a configurable root element and attribute support. Validate the input and download the XML file.
XML to JSON
Convert XML to JSON online, keeping attributes and turning repeated elements into arrays. Malformed XML is reported with its location.
JSON to YAML
Convert JSON to clean, human-readable YAML online. Turn API responses and package files into config for Kubernetes, Docker Compose or CI pipelines.
YAML to JSON
Convert YAML documents to formatted JSON online with syntax validation. Errors are reported by line, so broken indentation is quick to find and fix.