Hex Converter

Hexadecimal, or hex for short, writes numbers with sixteen digits: 0 to 9, then the letters A to F for ten to fifteen. Type a hex number (like 7EA, or a color code like FF5733) to see it in ordinary (decimal) numbers and in binary, or switch to convert a decimal or binary number into hex, with the steps worked out.

Whole numbers up to 64 hex digits. 0x, # and spaces are fine.

In decimal
1,024 Decimal

400 in hex is 1,024 in decimal.

Binary 10000000000
Bits 11
Bytes 2

What is hexadecimal?

Hexadecimal is a number system with sixteen digits: 0 – 9, then A (10), B (11), C (12), D (13), E (14) and F (15). Each place is worth 16 times the place to its right, the way each place in an everyday number is worth 10 times. It is also a short way to write binary: one hex digit stands for exactly four binary digits, as shown below.

Source OpenStax Contemporary Mathematics · 4.3 Converting with Base Systems ↗

How to convert hexadecimal to decimal

Multiply each digit by its place value (1, 16, 256, 4,096 …), then add them up.

Here it is with your numbers:

  1. Place values from the right: 1, 16, 256.
  2. Multiply: 4 × 256 + 0 × 16 + 0 × 1
  3. 1,024 + 0 + 0 = 1,024

It means 400 in hex and 1,024 in decimal are the same number.

How to convert decimal to hexadecimal

Divide by 16 again and again until you reach 0. The remainders, read from the bottom up, are the hex digits.

Here it is with your numbers:

  1. 1,024 ÷ 16 = 64, remainder 0
  2. 64 ÷ 16 = 4, remainder 0
  3. 4 ÷ 16 = 0, remainder 4
  4. Read the remainders from the bottom up: 400.

It means 1,024 in decimal and 400 in hex are the same number.

How to convert binary to hexadecimal

Split the binary digits into groups of four from the right. Each group is one hex digit, because 16 = 2 × 2 × 2 × 2.

Here it is with your numbers:

  1. Groups of four from the right, with zeros added at the front to fill the first group: 0100 0000 0000
  2. Each group is one hex digit: 0100 is 4, 0000 is 0, 0000 is 0.
  3. Put them together: 400.

It means 10000000000 in binary and 400 in hex are the same number.

This works because 16 is 2 × 2 × 2 × 2: four binary places count up to 15, exactly one hex digit, so each hex place lines up with four binary places. Going from hex to binary is the same in reverse: write each hex digit as four binary digits.

Hex to decimal chart

Tap a number to convert it.

DecimalHexBinary
000
111
2210
3311
44100
55101
66110
77111
881000
991001
10A1010
11B1011
12C1100
13D1101
14E1110
15F1111
161010000
3220100000
100641100100
255FF11111111
256100100000000
1,0003E81111101000
4,09610001000000000000

FAQs

What is hexadecimal?

Hexadecimal is base 16: it counts with sixteen digits, 0 – 9 and then A, B, C, D, E and F, and each place is worth 16 times the place to its right (1, 16, 256, 4,096 …). So 10 in hex is sixteen, and FF is 255.

Source OpenStax Contemporary Mathematics · 4.3 Converting with Base Systems ↗

What is A in hexadecimal?

A is 10. Hex needs single digits for ten to fifteen, so it uses letters: A is 10, B is 11, C is 12, D is 13, E is 14 and F is 15.

How to convert hexadecimal to decimal?

Multiply each digit by its place value and add. The place values from the right are 1, 16, 256, 4,096 … For 7EA: 7 × 256 + 14 × 16 + 10 × 1 is 1,792 + 224 + 10, which is 2,026.

How do I convert decimal to hexadecimal?

Divide by 16 again and again, writing down each remainder, until you reach 0. Write remainders of 10 to 15 as A to F, then read them from the last one to the first. 2,026 ÷ 16 is 126 remainder 10 (A), 126 ÷ 16 is 7 remainder 14 (E), and 7 ÷ 16 is 0 remainder 7, so 2,026 is 7EA.

Sources

Related calculators