Convert between hex and ASCII

Hex and ASCII, both ways.

Convert between hexadecimal bytes and ASCII text live. Accepts 0x-prefixed and space-separated hex. Pure browser; no upload.

Hex
ASCII

Text and hexadecimal bytes

Computers store text as bytes, and hexadecimal is the standard way to show those bytes to people. Each byte becomes two hex digits from 00 to ff, so the letter H, byte 72, is written 48. Programmers meet hex in network captures, file headers, colour codes, hashes, memory dumps and escape sequences such as \x48 in source code.

This converter works in both directions. Type text and see its UTF-8 bytes in hex, or paste hex and read the text it contains. Both fields stay in sync as you edit either one.

How to use it

  1. Type text into the text field to see its bytes in hex, separated by spaces.
  2. Or paste hex into the hex field. Spaces, line breaks and 0x prefixes are ignored.
  3. Read the other field, which updates as you type.
  4. If the hex has an odd number of digits or a character that is not 0–9 or a–f, the tool tells you instead of guessing.

Example: letters and an emoji

Input
Hi 👋
Output
48 69 20 f0 9f 91 8b

H, i and the space take one byte each. The waving-hand emoji takes four bytes in UTF-8, f0 9f 91 8b.

Why hex and not decimal?

A byte has 8 bits and a hex digit stands for exactly 4 of them, so every byte is always two digits and you can read the bits straight off: f is 1111 and 0 is 0000. Decimal byte values range from 0 to 255 with one to three digits and hide that structure, which is why debuggers and protocol specifications use hex.

UTF-8 and multi-byte characters

Plain English letters, digits and punctuation are ASCII and need one byte each, with values below 80 hex. Everything else uses two to four bytes in UTF-8: é is c3 a9, the euro sign is e2 82 ac, and most emoji start with f0. The first byte tells a decoder how many bytes follow, so a stray or missing byte makes the text invalid. When you decode hex that is not valid UTF-8, for example the bytes of an image, the tool reports an error rather than printing garbled characters.

Where hex shows up

File formats announce themselves in their first bytes: a PNG starts with 89 50 4e 47 and a PDF with 25 50 44 46, which is %PDF in text. Hash functions such as SHA-256 print their digests in hex, colour codes like #ff8800 are three hex bytes, and URL encoding writes bytes as % followed by two hex digits.

Questions

Does capitalisation matter in hex?

No. ff and FF are the same byte. This tool writes lowercase and accepts both.

Can I paste hex with 0x in front of each byte?

Yes. The 0x prefixes are stripped before decoding, as are spaces and line breaks.

Is my text uploaded?

No. The conversion happens in your browser tab only.