Skip to content
Tezmy Tools

Decimal to Hex Converter

Convert decimal numbers to hexadecimal, one per line, with no size limit

4 numbers converted.

Runs in your browser. Nothing is uploaded.

About the Decimal to Hex Converter

Hexadecimal, or base 16, is the notation programmers use for colours, memory addresses, byte values and error codes, because two hex digits describe exactly one byte. This converter turns ordinary decimal numbers into hex. Paste one number per line or just one number, and read the hex on the right. You can show the letters A to F in capitals or small letters, and add the 0x prefix that code expects. Negative numbers keep their minus sign and very large numbers are converted exactly, because the tool does not round. Everything runs in your browser.

Updated October 2026

How to use the Decimal to Hex Converter

  1. 1Type or paste your decimal numbers, one per line.
  2. 2Choose capital letters A to F or small letters.
  3. 3Tick Add the 0x prefix if your code needs it.
  4. 4Read the hexadecimal numbers on the right.
  5. 5Copy the result or download it.

Where hex shows up

Web colours such as #FF8800 are three bytes in hex. Memory addresses, MAC addresses, checksums and character codes are shown in hex because it is compact and lines up with binary. Developers converting a decimal value from a log or a spreadsheet into hex for a config file or a debugger do this constantly.

Pasting a whole column of values is faster than converting them one at a time on a calculator.

    Reading the result

    Each hex digit is worth 0 to 15, written 0 to 9 and A to F. Two digits make a byte, from 00 to FF. If you add the 0x prefix, programming languages such as C, Java, JavaScript and Python read the value as hex. Without the prefix you get the plain digits, which fits colour codes and similar uses.

    • 255 → FF
    • 4096 → 1000
    • 65535 → FFFF
    • -42 → -2A

    Handling mistakes

    A line with letters, a decimal point or other stray characters is shown with a warning that names the line and is not converted. Spaces, commas and underscores between digits are ignored, so 1,000 and 1_000 both read as one thousand. For the reverse conversion, use the Hex to Decimal Converter, and for several bases together, the Number Base Converter.

      Using it on phone and computer

      Paste decimal numbers, one per line, into the left box and the result appears straight away, so there is no button to press. On a phone, long-press the box to paste and use the Copy button to move the result to another app. On a computer you can also download it as a text file. Programmers often paste a column of IDs or sizes from a spreadsheet and copy the hex column back.

        Accuracy and limits

        As a check, 255 gives FF and 4096 gives 1000. The tool works with exact whole-number arithmetic rather than floating point, so long values are not rounded. Anything it cannot read is shown with a warning that names the line, and the rest of your list is still converted. Nothing you paste is uploaded or stored, and closing the tab removes it. To work with big binary values, use the Binary and Hex Calculator, and for other bases the Number Base Converter.

          Features

          • Many numbers at once
          • Capital or small letters
          • Optional 0x prefix
          • Exact for very large numbers
          • Negative numbers keep their sign
          • Bad lines flagged, not dropped

          Frequently asked questions

          How do I convert decimal to hex?

          Divide the number by 16 repeatedly and write down the remainders, from the last to the first, using A to F for 10 to 15. The tool does this for you: 255 becomes FF, and 6719 becomes 1A3F.

          What is 255 in hexadecimal?

          FF. The first F stands for 15 times 16, which is 240, and the second F adds 15, which makes 255. It is the largest value that fits in one byte.

          Does it handle negative numbers?

          Yes, a negative number is written with a minus sign in front of the hex of its size, so -42 becomes -2A. This is a signed notation, not the two's complement form used in memory.

          Is there a limit on the size of the number?

          No practical limit. The conversion uses exact whole-number arithmetic, so 2147483647 becomes 7FFFFFFF and numbers much longer than that stay exact.

          What happens to decimals with a fractional part?

          The tool is for whole numbers. A line like 3.5 is not a whole number, so it is marked with a warning and left unconverted.

          Is my data sent to a server?

          No. Numbers are converted in your browser and are not uploaded.

          Related tools