Bidirectional conversion between hex and ASCII/UTF-8 text
Input Text
Conversion Result
Conversion Result
Step-by-Step Derivation
Hex Encoding Principle
Text → Hex: Convert each character's ASCII/Unicode to hexadecimal
Hex → Text: Decode every two hex digits to decimal → look up corresponding character
UTF-8 example: One Euro sign "€" = 3 bytes (E282AC), one "A" = 1 byte (41)
Hex encoding is one of the most common ways to represent binary data in computer and network communications.
⚠Hex-text conversion does not change the data itself, only its representation. Non-ASCII characters like Chinese under UTF-8 encoding use 3 bytes (6 hex digits) per character.
What Is Hex Encoding?
Hex (hexadecimal) encoding represents binary data as hexadecimal strings. Each byte (8 bits) is represented by two hex digits. It is one of the most common data representation formats in network security, data analysis, and low-level development.
Text Encoding
Every character has a unique numeric code. ASCII uses 1 byte (7 bits); in UTF-8, English letters use 1 byte and Chinese characters use 3 bytes.
Hex Representation
Each byte is converted to two hex digits. For example, 65₁₀ = 41₁₆, so the letter "A" is represented as 41 in hex.
Bidirectional Mapping
Text and hex have a one-to-one correspondence. Text uniquely determines its hex encoding, and hex encoding uniquely reconstructs the original text.
Wide Applications
Hex is used for viewing binary file contents, network packet analysis, digital signatures, hash value display, and color representation (e.g., #FF0000).
💡 Teaching Example: "Hello" character ASCII codes: 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.
Applications
Network Packet AnalysisFile Format IdentificationHash DisplayNetwork SecurityEmbedded Development
Frequently Asked Questions
Why can text be converted to hexadecimal?▼
Every character in a computer has a unique numeric code (ASCII or Unicode). Representing that code in hexadecimal gives the hex form of the text. For example, the letter A has ASCII code 65₁₀ = 41₁₆.
What are the input format requirements for hex to text conversion?▼
Hex strings should have two characters per byte. They can be space-separated or continuous. For example, "48 65 6C 6C 6F" or "48656C6C6F" both represent "Hello". Odd digits are automatically padded with a leading 0.
What is the difference between ASCII and UTF-8?▼
ASCII uses 7 bits to represent 128 characters (0~127), including English letters, digits, and punctuation. UTF-8 is a variable-length Unicode encoding, compatible with ASCII. One character can be 1~4 bytes, supporting all written language systems worldwide (including Chinese).
Where is hex encoding used?▼
Hex encoding is widely used in: network packet analysis (e.g., Wireshark), file signature recognition (e.g., PNG header 89504E47), hash value display (e.g., MD5/SHA), binary data visualization and debugging, and encryption key representation.
Free online calculators and tools covering mathematics, unit conversion, text processing, and daily life. Accurate, fast, mobile-friendly, and completely free to use.