ASCII to Hex Converter
Convert text to hexadecimal character codes and back. Each character becomes its code unit in hex — two digits for ASCII characters, more for higher code points.
How to use this tool
- 1
Pick a direction from the dropdown: 'Text -> Hex' to encode, or 'Hex -> Text' to decode.
- 2
Type or paste your input into the text box.
- 3
Read the converted result in the output box below — it updates live as you type.
- 4
For decoding, separate each hex value with a space (for example '48 65 6C 6C 6F').
What does an ASCII to hex converter actually do?
Every character maps to a number, and hexadecimal (base 16) is a compact way to write that number. The letter 'A' is 65 in decimal and 41 in hex; a space is 20. This tool reads each character's code unit with JavaScript's charCodeAt and prints it in uppercase hex, padded to a minimum of two digits and joined by spaces. For plain ASCII and Latin-1 text (code points up to U+00FF) that yields the familiar two-digit-per-character output. Note that it reports UTF-16 code units, not UTF-8 bytes: the character 'e' with an accent (U+00E9) becomes E9 here, whereas its UTF-8 byte encoding would be C3 A9. Characters above U+00FF naturally produce three or four hex digits — the euro sign becomes 20AC. The conversion is handy for debugging text-encoding problems, inspecting control characters, building escape sequences, or working with simple binary or wire protocols where you need to see the raw code behind each glyph. Decoding reverses the process: it splits your input on whitespace and turns each hex token back into its character.
Common use cases
Inspecting invisible control characters (tabs, newlines, non-breaking spaces) that are breaking a parser or CSV import.
Hand-building escape sequences like \x41 for code, regex, or shell snippets.
Decoding a space-separated hex dump pasted from a log, packet capture, or protocol trace back into readable text.
Teaching or learning how characters map to numeric codes and base-16 notation.
Quickly checking the hex code of a specific symbol before hard-coding it into a config or test fixture.
Spotting smart quotes or homoglyphs by confirming whether a character is the plain ASCII version or a higher code point.
Frequently asked questions
Is this true ASCII or Unicode?▼
Does it output UTF-8 bytes?▼
Why does an emoji come out wrong?▼
How should I format hex for decoding?▼
Does it validate my hex input?▼
Is the output uppercase?▼
Is my text uploaded anywhere?▼
Related tools
JSON to CSV Converter
Convert JSON arrays to CSV.
CSV to JSON Converter
Convert CSV to JSON arrays.
CSV to SQL INSERT
Generate SQL INSERT statements from CSV.
Binary to Hex Converter
Convert binary numbers to hexadecimal.
Hex to Binary Converter
Convert hexadecimal to binary numbers.
Decimal to Binary Converter
Convert decimal numbers to binary, hex, octal.