Language
English English Vietnamese (Tiếng Việt) Vietnamese (Tiếng Việt) Chinese (简体中文) Chinese (简体中文) Portuguese (Brazil) (Português do Brasil) Portuguese (Brazil) (Português do Brasil) Spanish (Español) Spanish (Español) Indonesian (Bahasa Indonesia) Indonesian (Bahasa Indonesia)
Decimal to Hexadecimal

Decimal to Hexadecimal

Convert decimal numbers to hexadecimal. Perfect for creating color codes, working with memory addresses, and programming applications.

What is the Decimal to Hexadecimal Converter?

This tool converts decimal numbers (base-10) to hexadecimal (base-16), the preferred format for colors, memory addresses, and many other computing tasks.

How it works: divide by 16 repeatedly and convert the remainders, where 10=A, 11=B, 12=C, 13=D, 14=E, 15=F.

Why Convert Decimal to Hex?

Web Design

Build CSS color codes such as #RRGGBB from RGB values.

Programming

Read memory addresses and byte values in a compact form.

Hardware

MAC addresses and device IDs are written in hexadecimal.

Cryptography

Hashes and keys are commonly displayed as hex strings.

The Conversion Method

Divide by 16 repeatedly and convert each remainder to a hex digit, reading from the last remainder to the first.

Example: 255 = 15×16 + 15 → FF.

How to Use

1

Enter the Decimal Number

Type any positive integer using the digits 0–9.

2

View the Hex Result

The hexadecimal value appears in uppercase (using A–F) as you type.

3

Copy for Use

Add a 0x prefix for code or a # prefix for CSS colors, then copy.

Bidirectional: both fields are editable. Type a hexadecimal value in the result field to convert it back to decimal, or use the swap button to flip the direction.

Color Code Examples

R, G, BHexColor
255, 0, 0FF0000Red
0, 255, 000FF00Green
0, 0, 2550000FFBlue
255, 255, 255FFFFFFWhite

Frequently Asked Questions

Why do letters appear in the result?

Hexadecimal needs 16 symbols. After 0–9 it uses the letters A–F to represent the values 10 through 15.

How do I use the result as a CSS color?

Convert each RGB channel separately and join the three pairs, then add a #. For example, 255, 0, 0 becomes #FF0000.

Why does 255 equal FF?

255 = 15×16 + 15. Since 15 is written as F, both digits are F, giving FF — the maximum value of one byte.

What is the 0x prefix for?

In many programming languages, 0x marks a number as hexadecimal. For example, 0xFF tells the compiler to read FF as hex (255), not as the decimal digits.

0123456789
0123456789ABCDEFabcdef
0x

Common Conversions

10 = A
15 = F
16 = 10
255 = FF
256 = 100
65535 = FFFF

Decimal (Base-10)

The standard number system we use daily. Perfect for human calculations and display.

Hexadecimal (Base-16)

Compact representation ideal for computing. One hex digit = 4 binary bits.

Enter any positive integer
255 in decimal = FF in hex
Result can be used directly in CSS colors
Prefix with 0x for programming use
Want to learn more? Read documentation →
1/5
Start typing to search...
Searching...
No results found
Try searching with different keywords