Hex digits are the 16 symbols used in the hexadecimal number system: 0–9 and A–F. Each symbol represents a value from zero to fifteen. The letters take over after 9, so A means ten, B means eleven, and F means fifteen.
These hexadecimal digits are useful because of a simple relationship: sixteen equals two to the fourth power. A single hexadecimal digit can therefore represent any four-bit binary pattern. Two of them can show every possible value of an eight-bit byte, making long binary values much easier to inspect.
The main challenge is keeping three ideas separate: a digit's value, its position within a number, and the width of the data being displayed. Once those are clear, you can read hexadecimal values, convert them to other bases, and calculate how many symbols a binary field needs without guessing.
A Short Definition You Can Use
A hexadecimal digit is one symbol from 0–9 or A–F, with a numeric value from 0 to 15. Each digit corresponds to four binary bits, also called a nibble. Uppercase and lowercase letters have the same numeric meaning, so A and a both represent decimal 10.
All 16 Hex Digits and Their Values
The first ten symbols have the same values as decimal digits. The remaining six use letters so that each position still contains just one symbol.
Hexadecimal Digit | Decimal Value | Four-Bit Binary |
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 |
|
This is a table of numeric symbols, not ASCII letter codes. In this context, B is a digit with value eleven. The text character B has a separate character code, which matters only when you are encoding text.
Letters beyond F are not valid hexadecimal characters. Neither are lookalike letters such as O in place of zero or I in place of one.
Why Four Bits Match One Digit Exactly
A bit has two possible states, zero or one. Four bits have:
2⁴ = 16 possible patterns
That matches the sixteen available symbols in base 16. Every pattern from 0000 through 1111 has exactly one matching digit in the table.
The pattern 1011, for example, has value 8 + 2 + 1 = 11, so it becomes B. A group of four bits is called a nibble. An eight-bit byte contains two nibbles and can be displayed using two hexadecimal characters.
For B6, the two groups are:
B→10116→0110
Together they form 10110110. Keep the zero at the start of the second group; otherwise, the boundaries shift and the resulting binary value changes.
Four bits describe the information represented by one digit, not necessarily the storage used to write it as text. An ASCII or UTF-8 text string containing B6 occupies two bytes for those two characters. The underlying numeric value can fit in a single byte.
Counting Past F and Understanding Place Value
The hexadecimal number system is positional. Each position is worth sixteen times the position immediately to its right.
From right to left, the whole-number place values are:
1, 16, 256, 4,096, 65,536, ...
Counting begins 0, 1, 2, ... 9, A, B, C, D, E, F. There is no seventeenth single-digit symbol. After F, the rightmost position resets to zero and the next position increases, producing 10.
That 10 means sixteen in decimal, not ten. The counting sequence continues 11, 12, ... 19, 1A, ... 1F, 20.
Consider 3C:
(3 × 16) + (12 × 1) = 48 + 12 = 60
The 3 contributes forty-eight because of its position. The C contributes twelve. Simply adding 3 and 12 would ignore place value.
The same rule works for longer numbers. In 20B, the positions are 256, 16, and 1:
(2 × 256) + (0 × 16) + 11 = 523
The zero still holds a position. Removing it changes 20B to 2B, which is a different value.
Three Ways to Convert Hexadecimal Values
Choose a method that matches the input. Binary conversion uses four-bit groups, while decimal conversion uses place values or division.

Binary to Hex: Group from the Right
For a whole-number binary value, make groups of four starting at the rightmost bit. Add zeros on the left if the first group is incomplete.
Convert 1101010110:
- Group from the right:
11 0101 0110. - Pad the leftmost group:
0011 0101 0110. - Look up each group:
3,5, and6. - Read the result:
356.
The added zeros do not change the unsigned value. Adding zeros on the right would multiply it instead.
For the reverse operation, expand each hexadecimal character into its full four-bit pattern. Hexadecimal 2D becomes 0010 1101, which is decimal 45.
Hex to Decimal: Multiply and Add
To convert 7D2, use powers of sixteen:
Digit | Decimal Value | Position Weight | Contribution |
7 | 7 | 256 | 1,792 |
D | 13 | 16 | 208 |
2 | 2 | 1 | 2 |
Add the contributions: 1,792 + 208 + 2 = 2,002.
This method also provides a useful check after binary conversion. If the decimal results disagree, review the grouping and any missing zeros.
Decimal to Hexadecimal: Divide by 16
To convert decimal 734, divide repeatedly and keep each remainder:
Division | Quotient | Remainder |
734 ÷ 16 | 45 | 14 → |
45 ÷ 16 | 2 | 13 → |
2 ÷ 16 | 0 | 2 → |
Read the remainders from bottom to top: 2DE.
Verify the result with place values: 2 × 256 + 13 × 16 + 14 = 734. Stop dividing when the quotient reaches zero; decimal zero itself is simply written 0.
How Many Digits Does a Value Need?
For a nonnegative integer, the required width depends on its largest possible value. For a binary field, it depends on the number of bits you need to preserve.
A field with n hexadecimal positions can represent:
16ⁿ distinct unsigned values, from 0 through 16ⁿ − 1
Hexadecimal Positions | Binary Width | Maximum Unsigned Value | Maximum in Hex |
1 | 4 bits | 15 |
|
2 | 8 bits | 255 |
|
3 | 12 bits | 4,095 |
|
4 | 16 bits | 65,535 |
|
8 | 32 bits | 4,294,967,295 |
|
Notice the difference between the number of possible values and the largest value. Two positions give 256 possibilities because zero is included, but their maximum value is 255.
To display a b-bit field, use:
Required hex digits = ceiling(b ÷ 4)
The ceiling operation rounds up to the next whole number. A 10-bit field therefore needs three positions because 10 ÷ 4 = 2.5. Its maximum is 3FF, not FFF, because the field has ten available bits rather than twelve.
For an individual unsigned integer, choose the smallest n for which the value is less than 16ⁿ. Decimal 255 fits in two positions; decimal 256 needs three and is written 100.
Leading Zeros, Fixed Width, and Signed Interpretation
As ordinary positive numbers, 9, 09, and 0009 have the same value. Their written widths differ. Fixed-width formats use leading zeros to show a complete field, preserve alignment, or satisfy a protocol's rules.
A one-byte value is commonly displayed as 09, while a two-byte field with the same unsigned value might appear as 0009. Dropping zeros may be harmless in a calculator but inappropriate in a byte dump or identifier.
A numeric literal and a byte string also follow different rules. The number ABC is valid hexadecimal even though it has an odd number of characters. A sequence of whole bytes needs complete pairs, so a byte-oriented format may require 0A BC to represent that value.
Signedness adds another condition. For an eight-bit two's-complement integer, FF represents −1. Interpreted as an unsigned integer, the same bits represent 255. The symbols alone do not tell you which interpretation a data format requires.
Likewise, hexadecimal display does not establish byte order. Endianness describes the order of bytes in multibyte data, not a different meaning for individual hexadecimal characters.

Recognizing the Notation in Real Data
You will often see 0x before a hexadecimal integer, such as 0x2DE. The prefix identifies the number base; it is not part of the digit count. That example contains three numeric positions, not five.
Applications apply their own rules to the values:
Hex color codes. CSS accepts #RGB, #RGBA, #RRGGBB, and #RRGGBBAA. In six-character RGB notation, each pair gives a color channel from 00 to FF. The shorthand #3A7 expands to #33AA77 by repeating each character. The hash sign is a syntax marker, not a hexadecimal digit.
Memory addresses. Debuggers commonly display addresses using hexadecimal because the notation groups binary values compactly. The displayed width depends on the tool and address format, so a short address does not by itself prove the machine's architecture.
Byte dumps and error codes. A pair such as 8C can show a raw byte value. Whether it means a number, part of a character, or a flag pattern depends on the surrounding format. Hexadecimal makes the bits readable but does not explain their purpose.
Checking Input and Avoiding Conversion Errors
Start validation by identifying the expected format. A plain unsigned numeral can contain one or more characters from 0–9, A–F, or a–f. Prefixes, separators, signs, and decimal points require separate syntax rules.
For example, A9, a9, and 00A9 can all describe the same unsigned value. A9G fails a basic hexadecimal-character check. 0xA9 is valid in many programming contexts but would fail a validator that intentionally accepts only unprefixed digits.
Uppercase and lowercase letter forms do not add extra numeric values. There are still sixteen possible values per position, even though software may accept both A and a as spellings of ten.
When reviewing a hexadecimal conversion, check these three points:
- Every digit has the correct value, especially
A–F. - Each digit uses the correct position weight or four-bit group.
- The output preserves any width required by the data format.
Do not confuse a complete number with a single digit. Decimal sixteen is hexadecimal 10, while decimal ten is A. Also distinguish representation from compression: writing binary data in hexadecimal shortens its visual display, but it does not reduce the underlying information.

Hexadecimal Digit Questions, Answered
How many digits are there in hexadecimal?
There are sixteen distinct digit values, written 0–9 and A–F. Lowercase a–f can represent the same six values as uppercase A–F. If a list includes both letter cases, it contains multiple accepted spellings, not a larger number base. Each position still has only sixteen possible numeric values.
Why does hexadecimal use letters A through F?
Base 16 needs six more single-digit symbols than decimal provides. The letters A–F represent values ten through fifteen without needing two characters in one position. After F, counting carries into the next position, producing 10. Letters beyond F are unnecessary in the standard hexadecimal digit set.
How many bits does one hexadecimal digit represent?
One digit represents four bits because four binary positions have sixteen possible combinations. That four-bit group is a nibble. When converting to binary, write all four bits for each digit to preserve boundaries. The storage size of the digit as a text character is a separate question from its numeric meaning.
How many hexadecimal characters represent one byte?
An eight-bit byte can be represented by two hexadecimal characters, ranging from 00 through FF. Each character describes one four-bit half. This gives 256 possible byte values. Some numeric displays omit a leading zero, but a byte-oriented dump normally retains both characters so the byte boundaries remain clear.
What is the largest two-digit hexadecimal number?
The largest two-position unsigned value is FF, equivalent to decimal 255 and binary 11111111. There are 256 possible values from 00 through FF, including zero. If those eight bits represent a signed two's-complement integer, their interpretation changes; FF then means −1 rather than the largest positive signed value.
Are uppercase and lowercase hexadecimal letters different?
They have the same numeric meaning: AD, ad, and aD describe the same value. A tool may require a particular display style, and plain string comparisons can distinguish letter case, but the underlying hexadecimal number does not change. Follow the expected formatting rules when exchanging values between applications.
Do leading zeros change a hexadecimal number?
Leading zeros do not change the value of an unsigned integer. 7C and 007C both equal decimal 124. They can still matter when a field must have a fixed length or be interpreted using a specified bit width. Preserve them when working with byte sequences, signed fields, or structured identifiers.
A Reliable Way to Read the Next Value
Treat hex digits as numeric symbols first, then check the surrounding format. Use the value chart for individual positions, powers of sixteen for decimal conversion, and four-bit groups for binary conversion. Before removing zeros or interpreting a high bit as a sign, confirm the required width and whether the data is signed.