Skip to main content
HSCalculadora

Decimal to Hex Calculator

Convert a decimal number to hexadecimal.

Results update as you type.

Hexadecimal value
—

How it works

Hexadecimal, or hex, is the base-16 system widely used in computing, and this calculator converts a decimal number into hex. You enter a non-negative whole number in decimal, and it returns the hexadecimal equivalent. Hex uses sixteen symbols: the digits 0 through 9 and the letters A through F, which represent the values ten through fifteen. The conversion uses repeated division by sixteen: divide the number by sixteen, record the remainder as the next hex digit (writing A to F for remainders ten to fifteen), and repeat until the quotient is zero; reading the remainders in reverse gives the hex value. For example, decimal 255 becomes FF, because 255 is fifteen sixteens plus fifteen. Hex is popular because it maps cleanly to binary, with each hex digit representing exactly four bits, so a byte is two hex digits. This makes hex a compact, readable way to write binary data, and it appears throughout computing: web color codes like FF0000 for red, memory addresses, byte values, and low-level debugging. Converting decimal to hex is essential for programmers, web designers choosing colors, and computer science students. This calculator handles non-negative whole numbers and outputs uppercase hex digits. Enter a decimal number to convert it to hexadecimal.

Formula

Repeatedly divide by 16, reading remainders bottom-up

A decimal number is converted to hexadecimal by repeatedly dividing by sixteen and recording each remainder, converting remainders of 10 through 15 to the letters A through F. Reading the remainders from the last division to the first gives the hexadecimal value. Each digit corresponds to a place value that is a power of sixteen.

Source:Number systems

We review all our tools from time to time to ensure accuracy.

Worked example

Decimal number:255
255 = 15×16 + 15 = FF in hexadecimal.

How to use this calculator

  1. 1

    Enter your values

    Enter decimal number.

  2. 2

    Adjust the options

    Fine-tune any options to match your situation.

  3. 3

    Read your result

    Hexadecimal value updates instantly as you type — no button to press.

Frequently asked questions

How do you convert decimal to hexadecimal?

Repeatedly divide the decimal number by sixteen, recording each remainder and converting remainders of ten to fifteen into the letters A through F. Read the remainders in reverse order for the hex value. Decimal 255 gives FF. The calculator produces the hexadecimal result instantly from your decimal input.

What do the letters in hex mean?

In hexadecimal, the letters A through F represent the decimal values 10 through 15, which base 16 needs single symbols for. So A is 10, B is 11, up to F which is 15. They extend the digit set beyond 9 so each hex position can hold sixteen distinct values.

Why is hex used for colors?

Web colors are commonly written as six hex digits, like FF0000, where each pair of digits gives the red, green, and blue intensity from 0 to 255. Converting a decimal color value to hex with this calculator gives the code used in HTML and CSS, since hex compactly represents each 0-to-255 channel as two digits.

How does hex relate to binary?

Each hexadecimal digit corresponds to exactly four binary bits, because sixteen is two to the fourth power. So a byte of eight bits is written as two hex digits. This clean mapping makes hex a compact, human-readable shorthand for binary data, which is why it is used so widely in programming and computing.

Does this handle large numbers?

Yes, the calculator converts any non-negative whole decimal number to hexadecimal, and larger numbers simply produce more hex digits. Hex is efficient for large values, since each digit covers sixteen times the range of the previous one, so big numbers stay relatively short compared with their binary equivalents.