Converters & translators

Hex to Text Converter

Decode hex to text and convert text to hex, with auto-detect, UTF-8, ASCII or Latin-1, any hex format, invalid bytes highlighted and every byte in decimal and binary.

Updated · Free, no sign-up

Character encoding

The web’s standard: every character, 1 to 4 bytes each.

Hex layout

Hex
The result appears here as you type.

Share this tool

Know someone who’d love it?

How to convert hex to text

This hex to text converter turns hexadecimal codes back into readable text, and text into hex. Paste or type into the box and the result appears as you type. You don’t need to pick a direction: with Auto-detect on, the converter recognizes hex such as 48 65 6C 6C 6F and decodes it, and treats anything else as text to encode. If it guesses wrong (a short word made only of the letters A to F, for example), tap Hex → Text or Text → Hex to choose.

  1. Paste your hex. It can be spaced (48 65), continuous (4865), written with 0x prefixes, as \x48\x65 escapes, as a comma list, URL-style (%48%65) or split by colons or dashes. Upper and lower case both work.
  2. Check the encoding. UTF-8 is the default and right for almost everything made in the last twenty years. Switch to ASCII, Latin-1 or Unicode code points if your hex came from somewhere older or different (see below).
  3. Read the result. Bytes that cannot be decoded are highlighted in red with their hex, and invisible control characters such as a tab or a null byte show up as small labels, so nothing is hidden.
  4. Open “Byte by byte” to see every character with its hex, decimal and binary values, and the reason any byte failed.
  5. Copy the result, or tap Swap to convert it straight back the other way.

How to convert text to hex

Type or paste your text and the hex appears below. Three options shape the output:

  • Character encoding: UTF-8 gives the bytes a web page or file would really contain. ASCII and Latin-1 give one byte per character, and leave out (and list) any character they have no code for. Code points give each character’s Unicode number instead of bytes.
  • Hex layout: spaced (48 69 21), continuous (486921), 0x prefix (0x48 0x69 0x21), \x escapes (\x48\x69\x21), comma list (0x48, 0x69, 0x21). The 0x, escape and comma layouts are ready to paste into code.
  • Letter case: uppercase (6C) or lowercase (6c). They mean the same; it is only a matter of style.

Hex to text chart (ASCII table)

Find the first hex digit on the left and the second on top to read any character.

Worked example: “Hello” in hex

Every character has a number, and hex is just a short way to write that number. In UTF-8 (and in ASCII) the word “Hello” becomes 48 65 6C 6C 6F:

CharacterHexDecimalBinary
H487201001000
e6510101100101
l6C10801101100
l6C10801101100
o6F11101101111

To decode one byte by hand, multiply the first hex digit by 16 and add the second. For 48: 4 × 16 + 8 = 72, and character number 72 is the capital letter H. The letters A to F stand for the values 10 to 15:

Hex digitDecimalBinary
000000
110001
220010
330011
440100
550101
660110
770111
881000
991001
A101010
B111011
C121100
D131101
E141110
F151111

Because one hex digit is exactly four bits, two hex digits are exactly one byte, from 00 (0) to FF (255). That neat fit is why programmers write bytes in hex rather than in binary or decimal. To see the binary on its own, use the Binary Translator; to convert single numbers between hex, binary and decimal, use the Binary Converter.

UTF-8, ASCII and Latin-1: which encoding?

Hex is only a way of writing bytes. Which characters those bytes stand for depends on the encoding, so the same text gives different hex in different encodings. Here is “Café ☕” in each one:

EncodingHexNote
UTF-843 61 66 C3 A9 20 E2 98 95every character included
ASCII43 61 66 20é ☕ left out: no code for it
Latin-143 61 66 E9 20☕ left out: no code for it
Code points43 61 66 E9 20 2615every character included
  • ASCII is the original 7-bit code from the 1960s: 128 characters, hex 00 to 7F, covering English letters, digits, punctuation and control codes. Any byte above 7F is not ASCII, and the converter marks it.
  • Latin-1 (ISO-8859-1) keeps ASCII and uses A0 to FF for Western European letters such as é, ñ and ü. Every byte is exactly one character, so Latin-1 never fails, though it can show the wrong letters.
  • UTF-8 also keeps ASCII unchanged, and writes every other Unicode character as 2, 3 or 4 bytes. It is the standard on the web, so it is the default here.
  • Code points are not bytes at all, but each character’s Unicode number, as in U+00E9 for é. Use this when your hex looks like U+2615 or comes from a list of characters.

How many bytes does a character take in UTF-8?

CharacterCode pointUTF-8 hexBytes
AU+0041411
éU+00E9C3 A92
€U+20ACE2 82 AC3
😀U+1F600F0 9F 98 804

You can tell the length from the first byte: 00–7F is a whole character on its own, C2–DF starts a 2-byte character, E0–EF a 3-byte one and F0–F4 a 4-byte one. The bytes that follow are always between 80 and BF. The converter checks all of these rules, which is how it can point to the exact byte that is wrong.

Why does my text look like “Café”?

That is UTF-8 read as Latin-1. In UTF-8, é is two bytes, C3 A9; read one byte at a time as Latin-1, those become the two characters à and ©. So if decoded text is full of à and similar pairs, switch the encoding to UTF-8. The opposite mix-up gives the replacement character �: the Latin-1 byte for é, E9, is not valid UTF-8 on its own. Decoding 43 61 66 E9 as UTF-8 gives “Caf�”, while as Latin-1 it gives “Café”.

Invalid hex and how errors are shown

Instead of refusing the whole input or quietly producing nonsense, the converter decodes everything it can and highlights the rest:

  • Letters that are not hex. Only 0–9 and A–F are hex digits. In 48 65 6G 6C 6F the piece 6G is marked, and the rest still reads “Helo” around it.
  • An odd number of digits. A byte needs two hex digits, so a run such as 48656 leaves a lone 6 at the end, which is flagged. In spaced input a single digit such as A is read as 0A.
  • Bytes the encoding cannot use. Anything above 7F in ASCII, and broken sequences in UTF-8, are marked with the reason (“a continuation byte with no lead byte before it”, for example). Copying the result puts � in their place, as other programs do.

ASCII hex table

The printable ASCII characters, from the space (20) to the tilde (7E), with their hex, decimal and binary codes. These are the same in ASCII, Latin-1 and UTF-8. A handy pattern: capital letters run from 41 (A) to 5A (Z), small letters from 61 to 7A, exactly 20 higher, and the digits 0 to 9 are 30 to 39.

Printable ASCII characters with their hex, decimal and binary codes
CharHexDecBinary
space203200100000
!213300100001
"223400100010
#233500100011
$243600100100
%253700100101
&263800100110
'273900100111
(284000101000
)294100101001
*2A4200101010
+2B4300101011
,2C4400101100
-2D4500101101
.2E4600101110
/2F4700101111
0304800110000
1314900110001
2325000110010
3335100110011
4345200110100
5355300110101
6365400110110
7375500110111
8385600111000
9395700111001
:3A5800111010
;3B5900111011
<3C6000111100
=3D6100111101
>3E6200111110
?3F6300111111
@406401000000
A416501000001
B426601000010
C436701000011
D446801000100
E456901000101
F467001000110
G477101000111
H487201001000
I497301001001
J4A7401001010
K4B7501001011
L4C7601001100
M4D7701001101
N4E7801001110
O4F7901001111
P508001010000
Q518101010001
R528201010010
S538301010011
T548401010100
U558501010101
V568601010110
W578701010111
X588801011000
Y598901011001
Z5A9001011010
[5B9101011011
\5C9201011100
]5D9301011101
^5E9401011110
_5F9501011111
`609601100000
a619701100001
b629801100010
c639901100011
d6410001100100
e6510101100101
f6610201100110
g6710301100111
h6810401101000
i6910501101001
j6A10601101010
k6B10701101011
l6C10801101100
m6D10901101101
n6E11001101110
o6F11101101111
p7011201110000
q7111301110001
r7211401110010
s7311501110011
t7411601110100
u7511701110101
v7611801110110
w7711901110111
x7812001111000
y7912101111001
z7A12201111010
{7B12301111011
|7C12401111100
}7D12501111101
~7E12601111110

ASCII control characters

Codes 00 to 1F, and 7F, are control characters: instructions rather than visible symbols. Only a few still matter in everyday text: tab (09), line feed (0A, the new line on Linux and macOS) and carriage return (0D, which Windows puts before the line feed). The converter shows the others as small labels such as NUL.

ASCII control characters with their hex, decimal and binary codes
CharHexDecBinaryMeaning
NUL00000000000Null
SOH01100000001Start of Heading
STX02200000010Start of Text
ETX03300000011End of Text
EOT04400000100End of Transmission
ENQ05500000101Enquiry
ACK06600000110Acknowledge
BEL07700000111Bell
BS08800001000Backspace
HT09900001001Horizontal Tab
LF0A1000001010Line Feed (new line)
VT0B1100001011Vertical Tab
FF0C1200001100Form Feed
CR0D1300001101Carriage Return
SO0E1400001110Shift Out
SI0F1500001111Shift In
DLE101600010000Data Link Escape
DC1111700010001Device Control 1
DC2121800010010Device Control 2
DC3131900010011Device Control 3
DC4142000010100Device Control 4
NAK152100010101Negative Acknowledge
SYN162200010110Synchronous Idle
ETB172300010111End of Transmission Block
CAN182400011000Cancel
EM192500011001End of Medium
SUB1A2600011010Substitute
ESC1B2700011011Escape
FS1C2800011100File Separator
GS1D2900011101Group Separator
RS1E3000011110Record Separator
US1F3100011111Unit Separator
DEL7F12701111111Delete

Hex to text in code

If you need the same conversion inside a program, most languages have it built in. In Python, bytes.fromhex("48656c6c6f").decode("utf-8") gives 'Hello', and "Hello".encode("utf-8").hex() goes the other way. In JavaScript, a TextDecoder turns a Uint8Array of bytes into text and a TextEncoder turns text into bytes, which you then write with toString(16). Two things trip people up: the input usually has to be plain pairs of digits, without 0x prefixes, commas or escapes, and the encoding has to match the one the bytes were written in. The converter on this page takes care of both, so it is a quick way to check what a program should produce.

Where you meet hex text

  • Hex dumps of files and network data, where each byte is shown as two hex digits next to the readable text.
  • Code and data formats, where strings are written as escapes such as \x41 or as lists such as 0x41, 0x42.
  • Web addresses, which write unsafe characters as a percent sign and two hex digits: %20 is a space. Paste a run of them here to read them.
  • Puzzles, escape rooms and treasure-hunt clues, where a message is hidden as a string of hex. If the result looks like more hex, or like 0s and 1s, decode it again, or try the Binary Translator, the Morse Code Translator or the Caesar Cipher for the next layer.

The same base-16 notation is used for colors on the web (#FF0000 is red), memory addresses and error codes, though those are numbers rather than text.

Is anything uploaded?

No. The converter runs entirely in your browser: nothing you paste is uploaded, stored or logged, and it keeps working offline once the page has loaded. It handles up to 100,000 characters at a time.

For teachers, bloggers & clubs

Put the Hex to Text on your website

Give your readers this tool right on your page. Copy the code, paste it into your site, done: no sign-up, no account.

  • Free for any website
  • No ads, no cookies
  • Fits phones and sidebars
  • Always up to date
See it live ↗

Please keep the small credit line under the tool; you may add rel="nofollow" to its link. How it works & the rules

› Show the code

Frequently asked questions

How do I convert hex to text?
Paste the hex into the box, for example 48 65 6C 6C 6F, and the text (Hello) appears at once. Auto-detect recognizes hex by itself, and spaced, continuous, 0x, \x, comma and % layouts all work.
How do I convert text to hex?
Type or paste your text and the hex appears below. Choose UTF-8, ASCII, Latin-1 or code points, a layout (spaced, continuous, 0x, \x escapes or a comma list) and upper or lower case, then copy it.
What is 48 65 6C 6C 6F in text?
It spells Hello. 48 is H, 65 is e, 6C is l (twice) and 6F is o. Each pair of hex digits is one byte, and these bytes are the same in ASCII and UTF-8.
How do you convert hex to text by hand?
Split the hex into pairs, turn each pair into a number (first digit × 16 + second digit, with A to F meaning 10 to 15), and look the number up in an ASCII table. 48 is 4 × 16 + 8 = 72, which is the letter H.
What is the difference between UTF-8, ASCII and Latin-1?
ASCII has 128 characters (00 to 7F). Latin-1 adds Western European letters up to FF, one byte each. UTF-8 keeps ASCII and writes every other character as 2 to 4 bytes, so é is C3 A9 in UTF-8 but E9 in Latin-1.
Why does my decoded text show � or é?
The encoding doesn't match. é means UTF-8 bytes were read as Latin-1, so choose UTF-8. A � means a byte is not valid UTF-8, often a Latin-1 byte such as E9, so try Latin-1.
Why is a byte highlighted as invalid?
It is either not hex (only 0–9 and A–F are allowed), a lone digit without its pair, above 7F in ASCII, or a broken UTF-8 sequence. Open Byte by byte to see the exact reason for each one.
Can it convert hex to decimal or binary?
Yes. The Byte by byte table lists every character with its hex, decimal and binary values, in both directions.
Is anything uploaded?
No. The converter runs entirely in your browser, so nothing you paste is uploaded or stored, and it works offline once the page has loaded.

About this page

The Hex to Text is a free tool from Linguaholic, made by Marcel Iseli. It runs in your browser, with no sign-up. Last updated .

Keep exploring

Browse all 99 tools