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.
Hex codes
Hex codesstringmash.com/hex-to-text
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
- Wikipedia: Nibble
- Wikipedia: Hexspeak
- Oracle: The Java Virtual Machine Specification, Chapter 4. The class File Format
- W3C: Portable Network Graphics (PNG) Specification (Third Edition)
- RFC 3629: UTF-8, a transformation format of ISO 10646
- RFC 4648: The Base16, Base32, and Base64 Data Encodings
- Wikipedia: Java class file
Added . Last updated and reviewed . What's new






