Developer Encoding

ASCII to hex

Direction
Base
Text
Hex codes 48 65 6C 6C 6F
One byte per character, two hex digits each
Without spaces 48656C6C6F
Characters 5
Note
Joined form is what code expects
Advertisement
320 × 100

Each character becomes its code point in hexadecimal, padded to two digits for ASCII. "Hello" becomes 48 65 6C 6C 6F. The joined form without spaces is what most tools and protocols expect.

How to encode text as hex

1 Type or paste the text.
2 Read the codes spaced for reading, or the joined form for pasting into code.
3 Switch direction to decode hex back into text.
4 The count is characters read, not the number of bytes UTF-8 would need.

The joined form matters more than it looks. Protocols, hex editors and most command-line tools expect an unbroken string of hex digits with no separators: spaces are purely a reading aid.

What comes out here is code points, not UTF-8 bytes, and for anything above ASCII those are different numbers for the same character. The code point for é is E9, one value; its UTF-8 bytes are C3 A9, two of them. A party popper is code point 1F389 and four UTF-8 bytes, F0 9F 8E 89. Both readings are correct and they answer different questions: use code points when you are writing a character literal, and the bytes when you are counting storage or building a protocol frame.

Inside ASCII the arithmetic is simple: every character is one byte, padded to two hex digits, running from 00 to 7F. A newline is 0A, and a Windows line ending adds 0D before it, which is the usual explanation for one or two more codes coming out than you expected from a pasted block.

Questions

41. Lowercase "a" is 61.

Advertisement
300 × 250
Was this tool any good?
Internal signal only · I use it to find the tools worth rebuilding