Decimal to Hexadecimal Converter

Decimal ↔ Hexadecimal Converter

Convert between decimal (base 10) and hexadecimal (base 16) number systems instantly. Essential for programming, debugging, and color codes.

2026-03-28T00:00:00Z

Quick Select:

Enter a value to convert

What is Hexadecimal?

Hexadecimal (or hex) is a base-16 number system that uses sixteen distinct symbols: 0-9 represent values zero to nine, and A-F (or a-f) represent values ten to fifteen. It's widely used in computing because each hex digit represents exactly four binary digits (bits), making it a compact way to represent binary data.

Hexadecimal is extensively used in programming for memory addresses, color codes in web design (like #FF5733), representing binary data, Unicode characters, and MAC addresses. It's far more readable than binary while still maintaining a direct relationship with the underlying binary representation.

For example, the decimal number 255 is represented as FF in hexadecimal and 11111111 in binary. The hex version is much more compact and easier to work with than the binary representation.

Note: This converter supports non-negative integers only. It does not handle negative numbers or fractional/decimal values. For those conversions, use specialized tools designed for floating-point hexadecimal representation.

How to Convert

1

Select Mode

Choose "Decimal → Hex" or "Hex → Decimal" depending on your conversion direction.

2

Enter Value

Type your number in the input field. For decimal enter 0-9; for hex use 0-9 and A-F letters.

3

Instant Result

The conversion displays instantly as you type. See both the converted value and binary equivalent.

4

Quick Select

Use quick-select buttons for common values like 255 (FF) or 65535 (FFFF).

5

Verify Result

Cross-check using the binary representation. Each hex digit = 4 bits (F = 1111, 0 = 0000).

Example: Converting 255 to Hex

Convert decimal 255 to hexadecimal:

Step 1:
Divide 255 by 16:
255 ÷ 16 = 15 remainder 15 (F)
Step 2:
Divide quotient by 16:
15 ÷ 16 = 0 remainder 15 (F)
Step 3:
Read remainders bottom to top:
F, F → FF
Result:
255₁₀ = FF₁₆

Frequently Asked Questions

Why use hexadecimal in programming?

Hex is compact and directly maps to binary (4 bits per hex digit). It's easier to read and write than binary, making it ideal for memory addresses, color codes, and debugging.

What do A-F represent?

In hexadecimal: A=10, B=11, C=12, D=13, E=14, F=15. These letters extend the digit set beyond 0-9 to create a base-16 system.

How do color codes work?

Web colors use hex format #RRGGBB where each pair represents Red, Green, and Blue values (0-255 in decimal, 00-FF in hex). For example, #FF0000 is pure red.

Is hex case-sensitive?

No, hexadecimal letters A-F can be uppercase or lowercase. FF, ff, Ff, and fF all represent the same value (255 in decimal).

What's the largest 2-digit hex number?

FF (hexadecimal) equals 255 (decimal). This is the maximum value that can be stored in 8 bits, which is why it's common in color codes and byte representations.

How do you identify a hex number?

Hex numbers are often prefixed with '0x' (like 0xFF) in programming, or '#' for colors. Without a prefix, context determines the number system being used.

Can hex have decimals?

Yes, hexadecimal can represent fractional values using a point (like 1F.8), though this is less common. The digits after the point represent negative powers of 16.

What's the relationship to binary?

Each hex digit represents exactly 4 binary digits. For example, F₁₆ = 1111₂, and A₁₆ = 1010₂. This makes conversion between hex and binary very straightforward.

Related Tools