How to Read Hexadecimal

A practical guide to reading hexadecimal values, converting between hex and decimal or binary by hand, and checking your result.

What hexadecimal does for your text and data

Hexadecimal, or hex, is a base-16 numbering system. It uses the ten digits 0 through 9 plus the letters A through F, where A stands for 10, B for 11, C for 12, D for 13, E for 14, and F for 15. In text processing, hex often appears as a compact way to represent binary data, character codes, color values, memory addresses, checksums, or raw bytes. For example, a single byte can be written as two hex digits instead of eight binary digits.

Hex itself does not change your text unless you apply a conversion. Reading hex means interpreting the symbol as a numeric value and, when needed, mapping it to the character, byte, or color it represents. The main scope for a reader is usually one of three tasks: reading a hex number as a decimal value, converting it to binary, or understanding what a specific hex value means in a given encoding.

How to read a hex number as a decimal value

Each position in a hex number has a place value based on powers of 16. Reading from right to left, the rightmost position is worth 16 to the power of 0, which is 1. The next position is worth 16, then 256, then 4096, and so on. Multiply each hex digit by the place value of its position, then add the products.

For example, to read the hex value 2F, start from the right. F is 15 in decimal, and it occupies the 1s place, so it contributes 15 × 1 = 15. The digit 2 is in the 16s place, so it contributes 2 × 16 = 32. The total is 32 + 15 = 47. Therefore, hex 2F is decimal 47.

For a longer example, read 1A3. From right to left: 3 is in the 1s place and contributes 3. A is 10 in the 16s place and contributes 160. 1 is in the 256s place and contributes 256. The total is 256 + 160 + 3 = 419. As an illustrative example, the expected result is 419: 1 × 256 = 256, 10 × 16 = 160, and 3 × 1 = 3, giving 419.

How to convert hex to binary

Hex is useful because each hex digit maps to exactly four binary digits, also called bits. First convert the hex digit to its decimal value from 0 through 15. Then write that value as a four-bit binary number, adding leading zeros as needed.

Digit table for hex to binary

The mapping is: 0 is 0000, 1 is 0001, 2 is 0010, 3 is 0011, 4 is 0100, 5 is 0101, 6 is 0110, 7 is 0111, 8 is 1000, 9 is 1001, A is 1010, B is 1011, C is 1100, D is 1101, E is 1110, and F is 1111.

To convert the hex value 2F to binary, replace each digit independently. The digit 2 becomes 0010, and F becomes 1111. Put them together without a space: 00101111. The result is eight bits, which is one byte. If leading zeros do not affect the meaning in your context, you may omit them and write 101111, but when a byte or fixed-width field is expected, keep all eight bits.

How to read hex as text characters

Hex is not a character by itself. It becomes a character only through an encoding such as ASCII or UTF-8. In text processing, two hex digits often represent one byte, and an ASCII table maps that byte to a character. For example, hex 41 is decimal 65, which is the ASCII code for the uppercase letter A. Hex 6E is decimal 110, which is lowercase n.

To read a sequence, split it into byte-sized pairs and look up each pair in the encoding you are using. The illustrative sequence 48 65 6C 6C 6F maps as follows: 48 is H, 65 is e, 6C is l, 6C is another l, and 6F is o. Taken together, it spells the word Hello. The spaces between the pairs are shown here only as separators; the original hex sequence would be 48656C6C6F.

A caveat is important here. The same hex byte can map to different characters depending on the encoding. Hex 41 is A in ASCII and also in UTF-8 for the basic Latin range, but mappings can differ for values outside that range. Text tools often treat a pair of hex digits as a byte and may assume a newline convention or character encoding. If a tool discards or overwrites content during conversion, preserve a copy of the original text first.

How to check your conversion

A reliable check is to convert the result back in the other direction. Convert decimal 47 back to hex by repeatedly dividing by 16: 47 divided by 16 is 2 with remainder 15, so the hex digits are 2 and F, giving 2F. Convert binary 00101111 back to hex by splitting it into groups of four: 0010 is 2 and 1111 is F, again giving 2F.

For text, compare the characters you recover with the original text, including exact capitalization, whitespace, and special characters. Invisible characters such as a trailing space may map to hex 20 in ASCII and UTF-8. If your input contains such characters, make them explicit in the hex representation rather than letting them disappear silently.

Preserving content in hex workflows

Hex representation never changes the underlying byte values itself, but a conversion step can. For example, changing a two-digit hex value like 0A, which often represents a newline, into text may create a line break. If your tool offers an option for how to treat newlines or null bytes, check that setting before converting. When an operation can overwrite the original file, keep a backup or work on a copy.

As a practical rule, split the input into fixed-size groups before interpreting it. Two hex digits per byte is the common assumption in ASCII and UTF-8 text workflows, but not every hex string is byte-aligned. If the string has an odd number of digits, add a leading zero to form complete bytes only when the format calls for it. For example, the hex value 41 is one byte, while 414 is ambiguous and may need a leading zero to become 0414.