Skip to main content
CalcChef

ASCII to Hex Converter

Convert ASCII text or single characters to hex and back. Hello = 48 65 6C 6C 6F. Includes a printable ASCII to hex table. How it works

Use the ASCII to Hex Converter

Format
Hex output
11 characters as hex

About the ASCII to Hex Converter

In ASCII, “Hello” is 48 65 6C 6C 6F in hex: H = 48, e = 65, l = 6C, o = 6F. Every printable ASCII character has a two-digit hex code, from 20 (space) to 7E (~).

ASCII to hex table (codes 32 to 127)

Char (32–63)Dec (32–63)Hex (20–3F)Char (64–95)Dec (64–95)Hex (40–5F)Char (96–127)Dec (96–127)Hex (60–7F)
space3220@6440`9660
!3321A6541a9761
"3422B6642b9862
#3523C6743c9963
$3624D6844d10064
%3725E6945e10165
&3826F7046f10266
'3927G7147g10367
(4028H7248h10468
)4129I7349i10569
*422AJ744Aj1066A
+432BK754Bk1076B
,442CL764Cl1086C
-452DM774Dm1096D
.462EN784En1106E
/472FO794Fo1116F
04830P8050p11270
14931Q8151q11371
25032R8252r11472
35133S8353s11573
45234T8454t11674
55335U8555u11775
65436V8656v11876
75537W8757w11977
85638X8858x12078
95739Y8959y12179
:583AZ905Az1227A
;593B[915B{1237B
<603C\925C|1247C
=613D]935D}1257D
>623E^945E~1267E
?633F_955FDEL (control)1277F

Codes 0 to 31 and 127 (DEL) are control characters with no printed symbol. The ones you meet most: tab = 09, line feed = 0A, carriage return = 0D.

“Hello” in each output format

FormatOutput
Spaced, uppercase48 65 6C 6C 6F
Spaced, lowercase48 65 6c 6c 6f
Continuous48656C6C6F
0x prefix0x48 0x65 0x6C 0x6C 0x6F
Backslash-x escapes\x48\x65\x6C\x6C\x6F
HTML entities&#x48;&#x65;&#x6C;&#x6C;&#x6F;
Array literal[0x48, 0x65, 0x6C, 0x6C, 0x6F]
Unicode escapes\u0048\u0065\u006C\u006C\u006F

é, € and 😀 in each character encoding

Encodingé€😀
Unicode code points (default)E920AC1F600
UTF-8 bytesC3 A9E2 82 ACF0 9F 98 80
UTF-16 LE bytesE9 00AC 203D D8 00 DE
UTF-16 BE bytes00 E920 ACD8 3D DE 00
Windows-1252 bytesE9803F (not in the set)
ISO-8859-1 (Latin-1) bytesE93F (not in the set)3F (not in the set)

A character a single-byte set cannot hold is written as 3F, the byte for ?, and the page counts how many were replaced.

Methodology

Each character is replaced by its character code written in base 16 and padded to two digits. For plain ASCII text that code is the ASCII value, one byte per character. With a byte encoding chosen in the Character encoding menu (UTF-8, UTF-16 LE or BE, Windows-1252 or ISO-8859-1), the text is encoded in it first and every byte is listed. Hex → ASCII reads the input two hex digits at a time as bytes and decodes them as UTF-8, or in the chosen encoding, so 48 65 6C 6C 6F gives Hello and C3 A9 gives é. Groups written as &#x…; or \u… are read as code points.

How to use this tool

  1. Type or paste text. The hex appears as you type; the page opens with “Hello World”, which is 48 65 6C 6C 6F 20 57 6F 72 6C 64.
  2. Pick an output format and copy the result. The Character Inspector lists the decimal and hex code of every character.
  3. Switch to Hex → ASCII to decode. Switching direction empties the input box, so copy anything you still need first.

Frequently asked questions

How do I convert a character to hex by hand?
Look up its ASCII decimal code, divide by 16, and write the quotient and the remainder as hex digits, with 10 to 15 written as A to F. For k: 107 ÷ 16 = 6 remainder 11, so k = 6B.
What is “Hello” in hex?
48 65 6C 6C 6F. In lowercase, “hello” is 68 65 6C 6C 6F, and “Hello World” is 48 65 6C 6C 6F 20 57 6F 72 6C 64.
Do uppercase and lowercase letters have different hex codes?
Yes. A to Z are 41 to 5A and a to z are 61 to 7A. Each lowercase letter is exactly 20 hex (32 decimal) above its capital: M = 4D, m = 6D.
What is the hex code for a space, and for the digits 0 to 9?
Space is 20 (decimal 32). The digits 0 to 9 are 30 to 39, so the second hex digit is the number itself: 7 is 37.
What happens with characters that are not ASCII?
Anything above 7F is outside ASCII, so the result depends on the Character encoding menu. On Unicode code points, the default, é is E9 and € is 20AC. UTF-8 bytes give é as C3 A9, € as E2 82 AC and 😀 as F0 9F 98 80. UTF-16 LE and BE, Windows-1252 and ISO-8859-1 are there too; Windows-1252 writes € as 80, and ISO-8859-1, which has no €, writes 3F.
How do I convert hex back to ASCII?
Switch to Hex → ASCII and paste the hex. Pairs can run together or be separated by spaces, commas or hyphens, and a 0x in front of a pair is ignored: 48 65 6C 6C 6F, 48656C6C6F and 0x48,0x65,0x6C,0x6C,0x6F all decode to Hello.

Related Tools

View all tools