What is hexadecimal numbering? (2024)

What is hexadecimal?

Hexadecimal is a numbering system with base 16. It can be used to represent large numbers with fewer digits.

In this system there are 16 symbols or possible digit values from 0 to 9, followed by six alphabetic characters -- A, B, C, D, E and F. These characters are used to represent decimal values from 10 to 15 in single bits.

What is hexadecimal numbering? (1)

Hexadecimal explained

Hexadecimal -- also known as Base 16 or hex -- is one of four numbering systems. The other three are decimal (base 10), binary (base 2) and octal (base 8).

Here's what the decimal and hexadecimal systems look like for digits 0 to 15.

Decimal

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

Hexadecimal

1

2

3

4

5

6

7

8

9

A

B

C

D

E

F

The hexadecimal system contains 16 sequential numbers as base units, including 0. The first nine numbers (0 to 9) are the same ones commonly used in the decimal system. The next six two-digit numbers (10 to 15) are represented by the letters A through F. This is how the hex system uses the numbers from 0 to 9 and the capital letters A to F to represent the equivalent decimal number.

In this numbering system, each digit's position is 16 times more significant than the digit in the previous position. The hex number starts with the least significant digit on the right-hand side. The numeric value of this number is calculated by multiplying each digit by the value of its position and then adding the products. This is why hexadecimal is a positional or weighted number system.

The need for hexadecimal numbers

In computing systems, the binary string equivalents of large decimal numbers can become quite long. When 16- or 32-bit numbers are involved, it becomes difficult to read and write them without producing errors. These problems can be overcome by arranging the binary numbers into groups of four bits, i.e., by using the hexadecimal numbering system.

The format of hex numbers is more compact than binary numbers because they can represent large binary numbers with fewer digits. As a result, they are easier to understand than long binary strings of 1s and 0s.

Representation of hexadecimal numbers

In hex, four digits of a binary number can be represented by a single hex digit. Dividing a binary number into 4-bit sets means that each set can have a possible value of between 0000 and 1111, allowing 16 number combinations from 0 to 15. With the base value as 16, the maximum value of a digit is 15.

It's easy to convert a binary number into a hexadecimal number and vice versa. Here's how these numbers are represented in each system:

Hexadecimal number

1

2

3

4

5

6

7

4-bit binary number

0000

0001

0010

0011

0100

0101

0110

0111

Hexadecimal number

8

9

A

B

C

D

E

F

4-bit binary number

1000

1001

1010

1011

1100

1101

1110

1111

Additionally, the digits to the left of hexadecimal point have weights 160, 161, 162 and so on. Similarly, the positions to the right have weights of 16-1, 16-2, etc.

Example

To represent the decimal number 512 in hex:

Decimal value = 512

512 = 2x162+0x161+0x160=200

Hex value = 200

Converting binary and decimal numbers to hexadecimal

  1. Converting binary to hexadecimal

To convert binary numbers to hexadecimal, four binary digits must be mapped or converted to one hexadecimal digit. Here's how the conversion works:

  1. Split the binary value into groups of four, starting from the digit at the far right.
  2. Match each group of four against the corresponding hexadecimal value.
  3. Represent the original binary number in hexadecimal format.

Example

Here's how to convert the binary number 1011010101100001 to hex form:

See Also
Mint

Step 1: Split the binary value into groups of four.

1011

0101

0110

0001

Step 2: Replace each set with a hexadecimal value.

1011

0101

0110

0001

B

5

6

1

Step 3: Represent binary as hex

10110101011000012 = B56116

  1. Converting decimal to hexadecimal

The process of converting a decimal number to hexadecimal is simple, although there are more steps:

  1. Divide the decimal number by 16.
  2. Write the remainder in hexadecimal form.
  3. Divide the result by 16.
  4. Repeat steps 2 and 3 until the result is 0.

The hexadecimal value obtained is the sequence of remainders from the last to the first.

Example

Here's how to convert the decimal number 1128 to hexadecimal:

Step 1: Divide 1128 by 16 to arrive at the result of 70 and remainder 8.

Step 2: Divide the result (70) by 16 to get a new result 4 and remainder 6.

Step 3: Divide the result (4) by 16 to get the result of 0 and remainder 4.

Step 4: Represent the hexadecimal number as the sequence of remainders from the last to the first.

112810 = 46816

Hexadecimal identifiers

Hexadecimal numbers are usually prefixed or suffixed with identifiers to avoid confusion during reading or writing and to make it easy to distinguish hex numbers from decimal numbers. Some common hex identifiers include:

Identifier UsageExample

%

Commonly used in URLs to specify characters like spaces

%2

#

Used in HTML language as color references

#RR5687

0h

Used in programmable graphic calculators

0h7D

\x

Used in HTML, XML and other languages to express character control codes

\x08: Backspace

\x1B: Escape

0x

Used in UNIX and C-based programming

0x54EF

Other identifiers are also available; however, they are usually limited to specific programming languages and cannot be used interchangeably with other languages.

Hexadecimal applications

The hexadecimal numerical system is particularly useful in computer programming and microprocessors. Developers use it to describe colors on webpages, describe memory locations for each byte, to specify certain characters and more. Hex numbers are also used in microcontrollers to simplify data handling and manipulation. Other possible applications are data science and analytics, machine learning and artificial intelligence.

Hexadecimal advantages and disadvantages

Hex numbers are compact and use less memory, so more numbers can be stored in computer systems. Their small size also makes input-output handling easier compared to other numbering formats. Because it's easy to convert hexadecimal to binary and vice versa, the system is widely used in computer programming. It is also useful to represent computer memory addresses.

One drawback of the hexadecimal system is that it can be difficult to perform complex mathematical operations like multiplication and division. Hex numbers are also difficult to read and write compared to decimal numbers.

See also: Shared Key Authentication, Blowfish, network packet, big-endian and little-endian, globally unique identifier, universally unique identifier

What is hexadecimal numbering? (2024)

FAQs

What is hexadecimal number system answer? ›

The hexadecimal number system is a type of number system, that has a base value equal to 16. It is also pronounced sometimes as 'hex'. Hexadecimal numbers are represented by only 16 symbols. These symbols or values are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E and F. Each digit represents a decimal value.

How do you explain hexadecimal numbering? ›

Unlike the decimal system representing numbers using ten symbols, hexadecimal uses sixteen distinct symbols, most often the symbols "0"–"9" to represent values 0 to 9, and "A"–"F" (or alternatively "a"–"f") to represent values from ten to fifteen.

What do hexadecimal numbers consist of numbers between _______ and _______? ›

Hexadecimal explained

Here's what the decimal and hexadecimal systems look like for digits 0 to 15. The hexadecimal system contains 16 sequential numbers as base units, including 0. The first nine numbers (0 to 9) are the same ones commonly used in the decimal system.

How to write numbers in hexadecimal? ›

Digits in hexadecimal use the standard symbols 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 to represent the corresponding value, and use the first six letters of the alphabet to represent the values 10 through 15 (E.G: A, B, C, D, E, F). In programming, we prefix hexadecimal constants with 0x , with some exceptions.

How do you write 16 in hexadecimal? ›

However, 10 in the Decimal Number System is represented as A in the Hexadecimal System, 11 as B, 12 as C, 13 as D, 14 as E, 15 as F and 16 as 10.

How to write 20 in hexadecimal? ›

So, the hex value for 20 is 14 (and you say it as ONE – FOUR).

What is a hexadecimal number system for dummies? ›

The hexadecimal number system is a way of counting that uses 16 different symbols instead of just the ten we're used to. It uses the numbers 0-9 like we do, but it also uses the letters A-F to represent the numbers 10-15.

What is the hexadecimal system for dummies? ›

Hex, like decimal, combines a set of digits to create large numbers. It just so happens that hex uses a set of 16 unique digits. Hex uses the standard 0-9, but it also incorporates six digits you wouldn't usually expect to see creating numbers: A, B, C, D, E, and F. There are many (infinite!)

How to solve hexadecimal? ›

Take decimal number as dividend. Divide this number by 16 (16 is base of hexadecimal so divisor here). Store the remainder in an array (it will be: 0 to 15 because of divisor 16, replace 10, 11, 12, 13, 14, 15 by A, B, C, D, E, F respectively). Repeat the above two steps until the number is greater than zero.

What is an example of a hexadecimal conversion? ›

Example: Convert (92)10 to hexadecimal.
  • Divide 92 by 16. Quotient: 5, Remainder: 12 (C in Hexadecimal) ...
  • (1F7)16 = 1 × 162 + 15 × 161 + 7 × 160 ⇒ (1F7)16 = 1 × 256 + 15 × 16 + 7 × 1. ...
  • 0111 in binary is 7 in hexadecimal. 0010 in binary is 2 in hexadecimal. ...
  • Convert (A2)16 to decimal. ...
  • Multiply First Digit (1) by 16 squared (256)
Apr 8, 2024

How to write 1 in hexadecimal? ›

0001 is the binary representation of 1 (which is the same in denary and hexadecimal). 1010 is the binary representation of the denary number 10, which is represented in hexadecimal as A. So, binary 0001 1010 is equivalent to hexadecimal 1A.

Why is it called hexadecimal? ›

In The Art of Computer Programming, Donald Knuth [8, p. 202] notes that today's prevalent term for base 16, hexadecimal, is “a mixture of Greek and Latin stems,” 6 namely the Greek ἕξ (héx, “six”) and the Latin decem (“ten”).

What is an example of binary to hexadecimal? ›

Examples on Binary to Hexadecimal

We arrange the numbers together to get the final number. Therefore, (001101011)2 ( 001101011 ) 2 = (6B)16 ( 6 B ) 16 . Example 2: Find the decimal equivalent of (111001001110)2 . Therefore, (111001001110)2 ( 111001001110 ) 2 = (3662)10 ( 3662 ) 10 .

Is hexadecimal numbering base-16? ›

Hexadecimal is regarded as base-16. Each place value in the number is some power of 16. The hexadecimal values are: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F The letters A through F represent 10 through 15, respectively.

What is the hexadecimal number system sometimes called? ›

The hexadecimal numeral system, often shortened to "hex", is a numeral system made up of 16 symbols (base 16). The standard numeral system is called decimal (base 10) and uses ten symbols: 0,1,2,3,4,5,6,7,8,9.

Why is it called hexadecimal system? ›

In The Art of Computer Programming, Donald Knuth [8, p. 202] notes that today's prevalent term for base 16, hexadecimal, is “a mixture of Greek and Latin stems,” 6 namely the Greek ἕξ (héx, “six”) and the Latin decem (“ten”).

What is hexadecimal in real numbers? ›

The hexadecimal number is a number to the base (or radix) 16, and its magnitude is the sum of the product of the value of each digit in the number (h) and its position (n). This allows the creation of numbers with digits in the set: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.

Top Articles
Latest Posts
Article information

Author: Ouida Strosin DO

Last Updated:

Views: 5922

Rating: 4.6 / 5 (56 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Ouida Strosin DO

Birthday: 1995-04-27

Address: Suite 927 930 Kilback Radial, Candidaville, TN 87795

Phone: +8561498978366

Job: Legacy Manufacturing Specialist

Hobby: Singing, Mountain biking, Water sports, Water sports, Taxidermy, Polo, Pet

Introduction: My name is Ouida Strosin DO, I am a precious, combative, spotless, modern, spotless, beautiful, precious person who loves writing and wants to share my knowledge and understanding with you.