Hex Lab · Encoding Console

ASCII to Hex Converter

Encode any text to hexadecimal bytes (UTF-8) — with case, 0x prefix and spacing controls — decode hex back to text, inspect a per-character breakdown, and read a hex-editor style dump. Free, instant, private.

100% client-side UTF-8 correct hex ⇄ text no sign-up
Privacy: this converter runs entirely in your browser with JavaScript. Your text never leaves your device — zero network requests, nothing logged or stored.

⚠ Scope boundary — read before comparing tools

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.

Case
Spacing
13 bytes · 13 chars
char → code point → decimal → UTF-8 hex
CharCode pointDecimalUTF-8 hex bytes
offset · 16 bytes/row · ASCII

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

ASCII

A character set: it assigns numbers to characters. A = 65, a = 97, 0 = 48.

Hexadecimal

Base 16 — a compact way to write those numbers. 65 becomes 41.

Binary

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

In your own code

One-liners that do the same UTF-8 conversion outside this page:

LanguageText → 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"))
PHPbin2hex("Hi"); // back: hex2bin($hex)
Bashprintf '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.

20
!21
"22
#23
$24
%25
&26
'27
(28
)29
*2A
+2B
,2C
-2D
.2E
/2F
030
131
232
333
434
535
636
737
838
939
:3A
;3B
<3C
=3D
>3E
?3F
@40
A41
B42
C43
D44
E45
F46
G47
H48
I49
J4A
K4B
L4C
M4D
N4E
O4F
P50
Q51
R52
S53
T54
U55
V56
W57
X58
Y59
Z5A
[5B
\5C
]5D
^5E
_5F
`60
a61
b62
c63
d64
e65
f66
g67
h68
i69
j6A
k6B
l6C
m6D
n6E
o6F
p70
q71
r72
s73
t74
u75
v76
w77
x78
y79
z7A
{7B
|7C
}7D
~7E

Control characters — ascii hex dec table

NUL 00 SOH 01 STX 02 ETX 03 EOT 04 ENQ 05 ACK 06 BEL 07 BS 08 TAB 09 LF 0A VT 0B FF 0C CR 0D SO 0E SI 0F DLE 10 DC1 11 DC2 12 DC3 13 DC4 14 NAK 15 SYN 16 ETB 17 CAN 18 EM 19 SUB 1A ESC 1B FS 1C GS 1D RS 1E US 1F DEL 7F

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.

Free tool by NRTechStudio