StringMash.com

Text to hex converter

Turn text into hexadecimal bytes, or read a hex dump back into words.

Conversion
23 characters
Updates as you type
Decoded text

Printable chart

Using the hex converter

Paste hex on the left and it's read back as UTF-8 text, two digits to a byte. The sample spells Hi there. Swap the boxes to turn text into hex.

Decoding is forgiving about formatting. It ignores spaces, commas, colons and dashes, and strips 0x and \x prefixes, so you can paste from a hex dump, a debugger or a Stack Overflow answer without cleaning it up first. Separator changes what sits between bytes on the way out, and Letters picks lower or upper case.

Why bytes are written in hex

One byte holds a number from 0 to 255, which takes three digits in decimal and eight in binary. In base 16 it always takes exactly two, so a row of bytes lines up into neat columns and you can read a dump without counting.

The four bits behind each hex digit have their own name. A nibble, half a byte. The joke has been in the literature since the 1950s.

A–Z AND 0–9

Hex codes

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
030
131
232
333
434
535
636
737
838
939

The words hiding in hex

Hex uses A to F, so a handful of English words can be written as numbers. Programmers have been doing it for decades: 0xDEADBEEF marks freed memory in some systems, and 0xCAFEBABE is the first four bytes of every compiled Java class file, picked by James Gosling after a lunch spot his team called Cafe Dead.

It's worth learning a few. A file that begins 0xCAFEBABE or 0x89504E47 is telling you what it is before you open it, which is how the cipher identifier recognises formats too.

Related conversions

Hex, binary and Base64 all write the same bytes at different densities. Binary spends eight characters on a byte where hex spends two, and Base64 fits three bytes into four characters.

For the number behind a character rather than its bytes, see character codes and Unicode code points.

Questions

What does 0x mean?

A prefix saying the number is hexadecimal. This converter strips it when decoding, so 0x48 and 48 both work.

Why does my hex have an odd number of digits?

Each byte needs two, so an odd count means a digit was lost. The converter says so rather than guessing which one.

Can hex hold emoji?

Yes. An emoji is four bytes in UTF-8, so it comes out as eight hex digits.

Is hex the same as a hash?

No. A hash is a fixed-length fingerprint that can't be reversed. Hex here is a way of writing bytes, and it converts straight back.

Sources

Added . Last updated and reviewed . What's new