Developer Encoding

ASCII to binary

Direction
Base
Text
Binary 01001000 01101001
Each character padded to eight bits
Without spaces 0100100001101001
Characters 2
Note
Padded to eight bits so it decodes back
Advertisement
320 × 100

Each character becomes its code in binary, padded to eight bits. "Hi" becomes 01001000 01101001. Padding to a fixed width is what makes the result decodable again.

How to encode text as binary

1 Type or paste the text.
2 Read the binary, one eight-bit group per character.
3 Use the joined form only where whatever reads it already knows the width.
4 The count is characters, so anything above code point 255 will be wider than its neighbours.

Fixed-width padding is the whole trick. Without it, the letter A (1000001, seven bits) and a control character could run together ambiguously. Padding every character to eight bits means a decoder can simply take them eight at a time. It is the same principle as fixed-width fields in a data format, and the reason ASCII was defined as a seven-bit code stored in an eight-bit byte.

With the bits laid out, the design of ASCII becomes visible. A is 01000001 and a is 01100001: one bit apart, the one worth 32. A space is 00100000 — that same bit on its own. Flipping bit six is therefore the entire case conversion for the Latin alphabet, which is why old code changes case with a single bitwise operation rather than a lookup.

These are code points rather than UTF-8 bytes, and above 127 the two part company. é comes out as 11101001, a single eight-bit group, while its UTF-8 form is two bytes, 11000011 10101001. An emoji is wider still. Neither answer is wrong; they answer different questions, and a decoder expecting bytes will not read code points correctly.

Questions

01000001: code 65 padded to eight bits.

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