How to Convert Text to Hexadecimal
Converting text to hex involves encoding characters into bytes, then representing those bytes in base-16 notation. Start by selecting your character encoding from the dropdown:
- UTF-8 (recommended): Industry standard, handles all Unicode characters including emojis and non-Latin scripts with variable-length byte sequences.
- UTF-16: Fixed 2-byte characters with a byte-order mark (BOM) prefix; useful for systems expecting explicit endianness.
- UTF-16 LE/BE: Little-endian or big-endian without BOM; common in low-level applications.
- Windows-1252: Legacy single-byte encoding for Western European text.
Next, configure your separator—spaces, colons, or hyphens between byte pairs improve readability. Paste your text and the converter outputs each character's hex equivalent.
Text-to-Hex Conversion Process
The conversion follows a three-step pipeline:
1. Encode character → UTF-8 bytes (variable length)
2. Convert each byte value to base-16 (0–255 → 00–FF)
3. Join bytes with chosen separator
Character— Any single symbol (letter, digit, punctuation, emoji)Byte value— Numeric representation of the character in your chosen encoding (0–255 for single-byte, multiple for multi-byte)Hex pair— Two-digit hexadecimal notation (00–FF) of each byte
Hex Values for Common Characters
Uppercase and lowercase ASCII letters map to consistent hex ranges. Case matters—'A' and 'a' produce different outputs:
- A–Z: 41–5A
- a–z: 61–7A
- 0–9: 30–39
- Space: 20
- Exclamation (!): 21
- Period (.): 2E
Non-ASCII characters like é, ñ, or 中 require multi-byte sequences in UTF-8. For example, 'ñ' becomes C3 B1 (two bytes) rather than a single pair. Use the converter to explore how your text encodes across different character sets.
Understanding Hexadecimal and Encoding
Hexadecimal is a base-16 numeral system using digits 0–9 and letters A–F (A=10, B=11, up to F=15). This compact representation is preferred in computing because one hex digit describes half a byte (a nibble), and two hex digits represent one full byte—the atomic unit of digital storage.
Character encodings define how software maps abstract characters to numeric byte sequences. UTF-8 revolutionized text handling by using variable-length encoding: ASCII remains 1 byte, but accented characters, Greek, Arabic, CJK, and emoji require 2–4 bytes. Older encodings like Windows-1252 are single-byte and can't represent characters outside their defined range, making them unsuitable for international content.
Practical Considerations
Avoid common pitfalls when converting text to hexadecimal.
- Encoding choice affects output length — UTF-8 expands non-ASCII text (emoji can be 4 bytes), while Windows-1252 fails entirely on characters outside its range. Always verify your encoding matches your use case—web standards mandate UTF-8.
- Separator selection impacts readability — Spaces (48 65 6C 6C 6F) are human-friendly; colons (48:65:6C:6C:6F) or no separator (48656c6c6f) are common in programming and data formats. Choose based on where you'll paste the result.
- Case sensitivity in output — Hex pairs use uppercase A–F by convention but some systems prefer lowercase. Most tools accept both, but verify before inserting into code or protocols.
- Whitespace and control characters matter — Spaces, tabs, and newlines have hex values (20, 09, 0A respectively). Accidental trailing spaces in your input will appear in the hex output, potentially breaking string comparisons or network protocols.