⚠ Scope boundary — read before comparing tools
- This tool = text ↔ hex encoding / decoding. It converts characters to their hexadecimal byte values and back. That is its whole job.
- ASCII calculator vs ASCII to hex converter (different tool) = arithmetic on character codes — adding, subtracting or comparing code values. If you want to compute with codes, you want that tool, not this one.
- ASCII to Binary (sibling tool) = the same encoding idea but written in binary (base 2) instead of hexadecimal (base 16). Same characters, different notation.
01Converter
Live conversion as you type. Paste any plain text — a single word, a string, or a whole paragraph — and this plain text to hex converter (also called a string to hex converter) encodes it instantly. Switch direction with the tabs.
| Char | Code point | Decimal | UTF-8 hex bytes |
|---|
This hex to ASCII converter turns ascii hex to text — back into English letters, decoded as UTF-8. Tolerant decoder: 48 65 6C 6C 6F, 48656C6C6F and 0x48 0x65… all work. Odd-length input is rejected with an honest error — never silently padded.
02Worked examples
If you searched how to convert ASCII to hex, start here — three conversions done step by step, so you can check the math yourself.
Example 1 — "Hi" → hex, by hand
This is how to convert ASCII to hexadecimal manually. Look up each character's decimal code, then convert decimal → base 16 (divide by 16; the remainder is the low digit).
'H' → decimal 72 → 72 ÷ 16 = 4 remainder 8 → 48 'i' → decimal 105 → 105 ÷ 16 = 6 remainder 9 → 69 Result: 48 69 (check: 0x48 = 4×16+8 = 72 ✓)
Example 2 — "é" → hex (multi-byte UTF-8)
é is U+00E9 — too big for one byte, so UTF-8 encodes it as two bytes using the template 110xxxxx 10xxxxxx.
U+00E9 = binary 1110 1001 Split into 5 + 6 bits: 00011 | 101001 Byte 1: 110 + 00011 = 11000011 = C3 Byte 2: 10 + 101001 = 10101001 = A9 Result: C3 A9 (not E9 — that is the obsolete Latin-1 encoding)
Example 3 — hex → text: "48 65 6C 6C 6F"
Group into byte pairs, convert each hex pair → decimal → character.
48 → 4×16+8 = 72 → 'H' 65 → 6×16+5 = 101 → 'e' 6C → 6×16+12 = 108 → 'l' 6C → 108 → 'l' 6F → 6×16+15 = 111 → 'o' Result: Hello
03Methodology — how the conversion works
The encoding pipeline
Text → hex runs in two strict stages: (1) each character is encoded to bytes with UTF-8 (the web's standard encoding; basic ASCII characters become exactly one byte each), then (2) every byte is written as its two-digit ascii hex representation. Decoding reverses the pipeline: hex pairs → bytes → UTF-8 text. The per-character breakdown table above shows stage 1 for every character you type, so nothing is a black box.
Why UTF-8, not Latin-1 or "extended ASCII"
Older converters map é to the single byte E9 (Latin-1). That silently corrupts any text outside Western Europe. UTF-8 encodes é as C3 A9 and handles every script on earth — emoji included (😀 → F0 9F 98 80, four bytes). This is also the answer if you searched "ascii to unicode hex" or "hex to ascii utf 8": beyond basic ASCII, characters become multi-byte UTF-8 sequences, and this tool always shows you the true ascii to hex bytes. The per-character breakdown table above lists the byte count for every character so nothing is a black box.
ASCII vs hex vs binary — the 30-second version
A character set: it assigns numbers to characters. A = 65, a = 97, 0 = 48.
Base 16 — a compact way to write those numbers. 65 becomes 41.
Base 2 — the same numbers written bit by bit. 65 becomes 01000001.
This tool converts text → hex. Our sibling ASCII to Binary converter does text → binary (same codes, different notation). An ASCII calculator is something else again: it does arithmetic on the codes themselves.
Formatting notes
- Case:
48 69and48 69in lowercase are identical values — uppercase is the hex-editor convention, lowercase the Unix convention. - Endianness: bytes are emitted in reading order (big-endian byte order). The "little endian" some converters offer only matters when interpreting multi-byte numbers, not text.
- Odd-length hex can never be valid (every byte needs two digits) — this tool reports it as an error instead of guessing.
- Hex → decimal per byte (ascii to hex to decimal): the Decimal column of the per-character breakdown shows each byte's decimal value next to its hex. In other words, the breakdown is an ascii table hex and decimal lookup for any text you paste.
In your own code
One-liners that do the same UTF-8 conversion outside this page:
| Language | Text → hex |
|---|---|
| Excel formula | =TEXTJOIN("",1,DEC2HEX(CODE(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)),2)) (array formula, ASCII only) |
| PowerShell | [BitConverter]::ToString([Text.Encoding]::UTF8.GetBytes("Hi")) |
| PHP | bin2hex("Hi"); // back: hex2bin($hex) |
| Bash | printf 'Hi' | xxd -p // back: xxd -r -p |
04ASCII → hex reference table
Every printable ASCII character with its hex code — an ascii to hex table and ascii to hex chart in one, i.e. a complete ascii to hex conversion table: ascii table hex values for the full character set. Digits 0–9 = 30–39, A–Z = 41–5A, a–z = 61–7A (the full a–z range, i.e. ascii code of a to z hex, is in the grid). Quick lookups: ascii hex for space = 20 (ascii space hex value) · ascii hex for 0 = 30 · ascii hex of a = 61 · ascii lf hex / ascii hex newline = 0A.
Control characters — ascii hex dec table
05Frequently asked questions
14 questions answered — from basic conversion to Python, JavaScript and manual methods.
Type or paste your text into the encoder above. Each character is converted to its UTF-8 bytes, and every byte is written as a two-digit hexadecimal pair. For example, Hi becomes 48 69 because H is byte 0x48 (72 in decimal) and i is byte 0x69 (105 in decimal). Use the toggles to switch uppercase/lowercase, add a 0x prefix, or change the spacing between bytes.
To decode hex to ASCII, switch to the Hex to Text tab and paste your hex string. The decoder is tolerant: spaces, newlines, tabs, and 0x prefixes are all ignored, so 48 65 6C 6C 6F, 48656C6C6F, and 0x48 0x65 0x6C 0x6C 0x6F all decode to Hello. Each pair of hex digits becomes one byte, and the bytes are decoded as UTF-8 text.
It is an encoding, not encryption. ASCII assigns every character a number (A is 65); hexadecimal is just a base-16 way of writing numbers, so 65 is written as 41. Converting ASCII to hex rewrites each character's numeric code in hex notation. Anyone can reverse it, so it provides no security — it is used for debugging, data inspection, and preparing bytes for protocols.
Because this tool uses UTF-8, the web's standard encoding. In UTF-8, characters outside basic ASCII are stored as multiple bytes: é (U+00E9) becomes the two bytes C3 A9. Older single-byte encodings like Latin-1 wrote é as the single byte E9, but that breaks for most of the world's scripts. The per-character breakdown table on this page shows the byte count for every character so you can see exactly what happens.
Both are correct — 48 69 and 48 69 in lowercase mean the same bytes. Uppercase (48 69) is the common convention in hex editors and most documentation; lowercase is common in Unix tools and CSS colors. Pick whichever your target system expects using the case toggle above.
The 0x prefix is a notation borrowed from the C programming language that marks a number as hexadecimal, so 0x48 unambiguously means hex 48 (decimal 72) rather than decimal 48. Enable the prefix toggle if you are pasting values into code; leave it off for compact dumps.
Yes — at least in this tool's decoder. Real-world hex comes in many layouts (spaced bytes, line breaks every 16 bytes, 0x prefixes), so the Hex to Text tab strips all whitespace and 0x markers before decoding. The encoder lets you choose the output layout: spaced (48 69), compact (4869), or one byte per line.
An odd-length hex string is invalid because every byte needs exactly two hex digits — ABC cannot be split into whole bytes. This tool refuses to guess and shows an honest error instead of silently padding or dropping a digit. Fix it by finding the missing or extra nibble (often a dropped leading zero, e.g. ABC meant 0ABC).
Space is 20, the digit 0 is 30, uppercase A is 41, lowercase a is 61, and newline (line feed) is 0A. A handy pattern: digits 0–9 are 30–39, uppercase A–Z are 41–5A, and lowercase a–z are 61–7A. The reference table further down this page lists every printable character.
Use text.encode('utf-8').hex() — for example, 'Hi'.encode('utf-8').hex() returns '4869'. To decode back, use bytes.fromhex('4869').decode('utf-8'). Note that bytes.fromhex raises ValueError on odd-length input, matching this tool's honest-error behavior.
Use [...new TextEncoder().encode(text)].map(b => b.toString(16).padStart(2, '0')).join(' ') to encode, and new TextDecoder().decode(new Uint8Array(hex.match(/../g).map(h => parseInt(h, 16)))) to decode. This page itself runs the same logic entirely in your browser.
Look up each character's decimal code in an ASCII table, then convert decimal to base 16. Example: Hi. H is 72 in decimal; 72 ÷ 16 = 4 remainder 8, so hex 48. Lowercase i is 105; 105 ÷ 16 = 6 remainder 9, so hex 69. Result: 48 69. Worked example 1 below walks through this digit by digit.
ASCII is a character set — it assigns numbers to characters (A = 65). Hexadecimal and binary are just number bases for writing those numbers down: 65 is 41 in hex and 01000001 in binary. So this tool converts text to its hex representation, while our sibling ASCII to Binary converter writes the same codes in binary. If instead you want to do math on character codes (add, subtract, compare), that is what an ASCII calculator is for — a different job from encoding.
No. This converter runs 100% in your browser with JavaScript — your text never leaves your device, there are no network requests, and nothing is logged or stored. You can verify this with your browser's developer tools or disconnect from the internet and keep converting.