StringMash.com

Text to hex converter

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

Conversion
8 characters
Updates as you type
Two digits a byte

Using the hex converter

Type text on the left for hex on the right, two digits a byte. Swap the boxes to go back.

Decoding is forgiving about formatting. It ignores spaces and commas and strips any 0x 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.

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. That joke has been in the literature since the 1950s and nobody has managed to kill it.

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, chosen by James Gosling's team before Java was even called Java.

It is a good habit to know about. 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: two characters a byte, eight, and about 1.33.

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 cannot be reversed. Hex here is just a way of writing bytes, and it converts straight back.