Hex to Text Conversion: ASCII Table, Hex Dumps & Programming Guide
Learn how to convert hexadecimal to text using ASCII encoding. Includes complete ASCII hex table, how to read hex dumps, programming examples in Python and JavaScript, and common hex values every developer should know.
Hex to Text Conversion: ASCII Table, Hex Dumps & Programming Guide
Hexadecimal is the lingua franca of low-level computing. Whether you are debugging network packets, reading memory dumps, inspecting file headers, or working with cryptographic hashes, the ability to convert between hex and readable text is an essential skill.
This guide covers everything you need to know about hex-to-text conversion: how ASCII and UTF-8 map characters to hex values, how to read hex dumps, and how to perform conversions in code. Try our free hex to text converter to follow along with any example below.
How Hex Represents Text
Computers store text as sequences of bytes, where each byte has a numeric value between 0 and 255. Hexadecimal (base-16) provides a compact way to express these byte values using exactly two digits per byte (00 to FF).
The mapping from bytes to characters is defined by character encodings:
- ASCII: Maps values 0-127 to English letters, digits, punctuation, and control characters
- UTF-8: Extends ASCII to cover all Unicode characters (every script, symbol, and emoji)
Example: "Hello" in Hex
| Character | ASCII Decimal | Hex Value |
|---|---|---|
| H | 72 | 48 |
| e | 101 | 65 |
| l | 108 | 6C |
| l | 108 | 6C |
| o | 111 | 6F |
So "Hello" in hex is: 48 65 6C 6C 6F
Complete ASCII Hex Table
The ASCII standard defines 128 characters (0-127). Here are all 95 printable characters with their hex, decimal, and binary values:
Digits (0x30-0x39)
| Char | Hex | Dec | Binary |
|---|---|---|---|
| 0 | 30 | 48 | 00110000 |
| 1 | 31 | 49 | 00110001 |
| 2 | 32 | 50 | 00110010 |
| 3 | 33 | 51 | 00110011 |
| 4 | 34 | 52 | 00110100 |
| 5 | 35 | 53 | 00110101 |
| 6 | 36 | 54 | 00110110 |
| 7 | 37 | 55 | 00110111 |
| 8 | 38 | 56 | 00111000 |
| 9 | 39 | 57 | 00111001 |
Uppercase Letters (0x41-0x5A)
| Char | Hex | Dec | Char | Hex | Dec | Char | Hex | Dec |
|---|---|---|---|---|---|---|---|---|
| A | 41 | 65 | J | 4A | 74 | S | 53 | 83 |
| B | 42 | 66 | K | 4B | 75 | T | 54 | 84 |
| C | 43 | 67 | L | 4C | 76 | U | 55 | 85 |
| D | 44 | 68 | M | 4D | 77 | V | 56 | 86 |
| E | 45 | 69 | N | 4E | 78 | W | 57 | 87 |
| F | 46 | 70 | O | 4F | 79 | X | 58 | 88 |
| G | 47 | 71 | P | 50 | 80 | Y | 59 | 89 |
| H | 48 | 72 | Q | 51 | 81 | Z | 5A | 90 |
| I | 49 | 73 | R | 52 | 82 |
Tip: Uppercase letters start at 0x41 (65). Lowercase letters start at 0x61 (97). The difference is exactly 0x20 (32) -- flipping bit 5 toggles case.
Lowercase Letters (0x61-0x7A)
| Char | Hex | Dec | Char | Hex | Dec | Char | Hex | Dec |
|---|---|---|---|---|---|---|---|---|
| a | 61 | 97 | j | 6A | 106 | s | 73 | 115 |
| b | 62 | 98 | k | 6B | 107 | t | 74 | 116 |
| c | 63 | 99 | l | 6C | 108 | u | 75 | 117 |
| d | 64 | 100 | m | 6D | 109 | v | 76 | 118 |
| e | 65 | 101 | n | 6E | 110 | w | 77 | 119 |
| f | 66 | 102 | o | 6F | 111 | x | 78 | 120 |
| g | 67 | 103 | p | 70 | 112 | y | 79 | 121 |
| h | 68 | 104 | q | 71 | 113 | z | 7A | 122 |
| i | 69 | 105 | r | 72 | 114 |
Common Symbols (0x20-0x2F, 0x3A-0x40, 0x5B-0x60, 0x7B-0x7E)
| Char | Hex | Dec | Char | Hex | Dec | Char | Hex | Dec |
|---|---|---|---|---|---|---|---|---|
| (space) | 20 | 32 | : | 3A | 58 | [ | 5B | 91 |
| ! | 21 | 33 | ; | 3B | 59 | \ | 5C | 92 |
| " | 22 | 34 | < | 3C | 60 | ] | 5D | 93 |
| # | 23 | 35 | = | 3D | 61 | ^ | 5E | 94 |
| $ | 24 | 36 | > | 3E | 62 | _ | 5F | 95 |
| % | 25 | 37 | ? | 3F | 63 | ` | 60 | 96 |
| & | 26 | 38 | @ | 40 | 64 | { | 7B | 123 |
| ' | 27 | 39 | } | 7D | ||||
| ( | 28 | 40 | ~ | 7E | 126 | |||
| ) | 29 | 41 | ||||||
| * | 2A | 42 | ||||||
| + | 2B | 43 | ||||||
| , | 2C | 44 | ||||||
| - | 2D | 45 | ||||||
| . | 2E | 46 | ||||||
| / | 2F | 47 |
How to Read Hex Dumps
A hex dump displays file or memory contents in a standardized format with three columns:
Offset Hex bytes ASCII
00000000 48 65 6C 6C 6F 2C 20 57 6F 72 6C 64 21 0A 54 68 |Hello, World!.Th|
00000010 69 73 20 69 73 20 61 20 68 65 78 20 64 75 6D 70 |is is a hex dump|
00000020 20 65 78 61 6D 70 6C 65 2E 0A | example..|
Column Breakdown
- Offset (left): Memory address or file position in hex. Each row is 16 bytes apart (0x10).
- Hex bytes (middle): 16 bytes shown as hex pairs, often split into two groups of 8.
- ASCII (right): Printable characters shown as-is; non-printable bytes shown as
.
Common Control Characters in Hex Dumps
| Hex | Name | Meaning |
|---|---|---|
| 00 | NUL | Null byte (string terminator in C) |
| 0A | LF | Line feed (Unix newline \n) |
| 0D | CR | Carriage return (\r) |
| 0D 0A | CRLF | Windows newline (\r\n) |
| 09 | TAB | Horizontal tab (\t) |
| 1B | ESC | Escape character |
| 7F | DEL | Delete |
Command-Line Hex Dump Tools
UTF-8 Multi-Byte Characters
ASCII covers only 128 characters. For international text, emoji, and symbols, UTF-8 uses 1 to 4 bytes per character:
| Unicode Range | Bytes | Hex Pattern | Example |
|---|---|---|---|
| U+0000-U+007F | 1 byte | 0xxxxxxx | A = 41 |
| U+0080-U+07FF | 2 bytes | 110xxxxx 10xxxxxx | é = C3 A9 |
| U+0800-U+FFFF | 3 bytes | 1110xxxx 10xxxxxx 10xxxxxx | 中 = E4 B8 AD |
| U+10000-U+10FFFF | 4 bytes | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx | 😀 = F0 9F 98 80 |
How to Identify UTF-8 in Hex
The leading byte tells you how many bytes the character uses:
00-7F: Single byte (ASCII)C0-DF: First byte of a 2-byte characterE0-EF: First byte of a 3-byte characterF0-F7: First byte of a 4-byte character80-BF: Continuation byte (never starts a character)
Hex-to-Text Conversion in Programming
Python
JavaScript
Command Line
Common Hex Values Every Developer Should Know
| Hex | Meaning | Where You'll See It |
|---|---|---|
FF FE | UTF-16 LE BOM | Start of UTF-16 files |
FE FF | UTF-16 BE BOM | Start of UTF-16 files |
EF BB BF | UTF-8 BOM | Start of UTF-8 files (optional) |
89 50 4E 47 | PNG file header | .png magic bytes |
FF D8 FF | JPEG file header | .jpg magic bytes |
25 50 44 46 | PDF file header (%PDF) | .pdf magic bytes |
50 4B 03 04 | ZIP file header | .zip, .docx, .jar magic bytes |
7F 45 4C 46 | ELF header | Linux executables |
CA FE BA BE | Java class file | .class magic bytes |
DE AD BE EF | Debug marker | Common debug/magic constant |
00 00 00 00 | Null bytes | Uninitialized memory |
These "magic bytes" (file signatures) at the start of files identify the file format regardless of the file extension.
Hex to Text vs Hex to Decimal
These are different operations that are frequently confused:
| Operation | Input | Output | Purpose |
|---|---|---|---|
| Hex to text | 48 65 6C 6C 6F | Hello | Character encoding lookup |
| Hex to decimal | FF | 255 | Number base conversion |
| Hex to binary | A3 | 10100011 | Number base conversion |
Hex to text interprets each hex pair as a character encoding (ASCII/UTF-8). Hex to decimal converts a hex number to base-10. Use our hex to decimal converter for number conversions or our hex to binary converter for binary conversions.
Frequently Asked Questions
How do I know if a hex string is text or binary data?
Look at the byte values. If most bytes fall in the printable ASCII range (0x20-0x7E), it is likely text. If you see many values outside this range (especially 0x00, 0x80-0xFF), it is probably binary data. Hex dump tools show the ASCII interpretation alongside hex values to help you identify text within binary files.
Why do some hex strings start with 0x?
The 0x prefix is a programming convention (used in C, Java, Python, JavaScript) that tells the compiler/interpreter the number is hexadecimal, not decimal. It has no effect on the value: 0x41 and 41 in hex are the same number. When converting hex to text, strip any 0x prefixes before processing.
What is the difference between big-endian and little-endian hex?
Endianness affects the byte order of multi-byte values (like integers), not individual bytes. Big-endian stores the most significant byte first (0x00 0x01 = 1), while little-endian stores the least significant byte first (0x01 0x00 = 1). Text encoding (ASCII/UTF-8) is always read left-to-right, so endianness does not affect hex-to-text conversion.
Ready to convert hex? Try our hex to text converter for instant conversion with a character breakdown table. For related conversions, check out our hex to binary converter, hex to decimal converter, and binary translator.