Denary to Hexadecimal Converter

Convert denary (decimal, base 10) numbers to hexadecimal (base 16) format instantly. Hexadecimal uses digits 0-9 and letters A-F to represent values, making it popular in computing for memory addresses, colour codes, and data representation.

Please enter a valid non-negative whole number

Quick Convert

Denary to Hexadecimal Conversion Table

Here’s a reference table showing common denary values and their hexadecimal equivalents. This is particularly useful for programmers and computer science students.

Denary (Base 10) Hexadecimal (Base 16) Denary (Base 10) Hexadecimal (Base 16)
0 0 16 10
1 1 32 20
2 2 64 40
3 3 128 80
4 4 255 FF
5 5 256 100
6 6 512 200
7 7 1000 3E8
8 8 1024 400
9 9 2048 800
10 A 4096 1000
11 B 8192 2000
12 C 16384 4000
13 D 32768 8000
14 E 65535 FFFF
15 F 1048576 100000

Hexadecimal Digit Values

Hexadecimal uses 16 distinct symbols. The first ten are identical to denary (0-9), whilst the letters A through F represent values ten through fifteen.

0 = 0
1 = 1
2 = 2
3 = 3
4 = 4
5 = 5
6 = 6
7 = 7
8 = 8
9 = 9
A = 10
B = 11
C = 12
D = 13
E = 14
F = 15

Conversion Method and Steps

Division-Remainder Method

The most straightforward way to convert denary to hexadecimal involves repeated division by 16. This method works for any positive whole number and is commonly taught in GCSE Computer Science.

  1. Divide your denary number by 16
  2. Record the quotient (result) and the remainder
  3. If the remainder is 10-15, convert it to its hexadecimal letter (A-F)
  4. Divide the quotient by 16 again
  5. Repeat steps 2-4 until your quotient reaches 0
  6. Write all remainders in reverse order (bottom to top)

Worked Example 1: Convert 157 to Hexadecimal

Step 1: 157 ÷ 16 = 9 remainder 13 (D in hex)

Step 2: 9 ÷ 16 = 0 remainder 9

Result: Reading from bottom to top: 9D

So 157 in denary equals 9D in hexadecimal.

Worked Example 2: Convert 2019 to Hexadecimal

Step 1: 2019 ÷ 16 = 126 remainder 3

Step 2: 126 ÷ 16 = 7 remainder 14 (E in hex)

Step 3: 7 ÷ 16 = 0 remainder 7

Result: Reading from bottom to top: 7E3

So 2019 in denary equals 7E3 in hexadecimal.

Worked Example 3: Convert 255 to Hexadecimal

Step 1: 255 ÷ 16 = 15 remainder 15 (F in hex)

Step 2: 15 ÷ 16 = 0 remainder 15 (F in hex)

Result: Reading from bottom to top: FF

255 is the maximum value that can be represented by two hexadecimal digits, commonly used for RGB colour values.

Where Hexadecimal Gets Used

Web Colours

When you specify colours in CSS or HTML, you’re using hexadecimal. The code #FF5733 represents red (FF), green (57), and blue (33) values. Each pair is a hexadecimal number from 00 to FF (0 to 255 in denary).

Memory Addresses

Computer programmers use hexadecimal to reference memory locations. Instead of writing long binary addresses, hex provides a compact format. The address 0x7FFF represents a specific location in memory.

MAC Addresses

Every network card has a unique MAC address written in hexadecimal, like 00:1A:2B:3C:4D:5E. This identifies devices on networks.

Character Encoding

Unicode characters are often referenced by their hex code point. The pound sign (£) is U+00A3 in Unicode, where A3 is hexadecimal for 163.

Assembly Language

Low-level programming frequently uses hex values to represent opcodes and memory addresses because they’re more readable than binary but closer to how computers actually work.

Number System Conversions

Here’s how denary, binary, and hexadecimal relate to each other for the same values.

Denary Binary Hexadecimal Notes
0 0000 0 Minimum 4-bit value
8 1000 8 One byte half-value
15 1111 F Maximum single hex digit
16 10000 10 Base of hexadecimal
255 11111111 FF Maximum byte value
256 100000000 100 One byte plus one
4096 1000000000000 1000 4 kilobytes
65535 1111111111111111 FFFF Maximum 16-bit value

FAQs

What does denary mean?

Denary is another word for decimal—the base-10 number system we use every day. It’s called “denary” because it uses ten digits (0-9), with each position representing a power of ten.

Why do we use hexadecimal in computing?

Hexadecimal provides a compact way to represent binary data. Four binary digits (bits) equal one hex digit, so programmers can write shorter, more readable codes. It’s particularly useful for memory addresses, colour codes, and debugging.

How do I convert hexadecimal back to denary?

Multiply each hex digit by 16 raised to its position power (starting from 0 on the right), then add the results. For example, 2F = (2 × 16¹) + (15 × 16⁰) = 32 + 15 = 47.

Can I convert negative numbers to hexadecimal?

Computers represent negative numbers using two’s complement notation in binary, which can then be expressed in hexadecimal. However, the standard denary-to-hex conversion process applies only to non-negative whole numbers.

What’s the largest number I can represent with two hex digits?

FF represents the largest two-digit hexadecimal number, which equals 255 in denary. This is why RGB colour values range from 00 to FF—they need to fit within one byte (8 bits) of computer memory.

Is hexadecimal case-sensitive?

No. The letters A-F in hexadecimal can be written in uppercase or lowercase. Both 2A and 2a represent the same value (42 in denary). However, most programming conventions prefer uppercase.

Do I need to show working in GCSE exams?

Yes. Most exam boards want to see your method. Write out each division step with quotients and remainders clearly shown. Even if you make a small error, you can still earn method marks.

What’s the 0x prefix I see in code?

The 0x prefix indicates that the following number is hexadecimal. So 0x1A means 1A in hex (26 in denary). Different programming languages use various notations, including &H, #, or simply appending ‘h’.

Can I convert decimals (fractions) to hexadecimal?

Yes, but it requires a different method involving multiplication rather than division. The converter on this page handles whole numbers only, which covers most practical computing applications.

Why does my answer have letters in it?

Hexadecimal needs 16 distinct symbols. Since we only have ten digits (0-9), the letters A through F represent values 10 through 15. This is perfectly normal—they’re not variables but actual digits in the base-16 system.

Scroll to Top