How to use
- Choose Encode to produce an xxencoded block, or Decode to turn one back into data.
- Leave the begin and end lines on and set a file name for a complete block, or turn them off to get the data lines only.
- Type or paste your input, or open a file. The result updates as you type.
- Copy the result or download it. When decoding, choose Hex output or download the file if the data is not text.
What is xxencode?
Xxencode keeps the structure of uuencode and changes only the characters. Every 3 bytes still become four 6-bit values, data lines still hold up to 45 bytes behind a length character, and the block still sits between a begin 644 name line and an end line.
The 64 values are mapped to +, -, the digits 0-9, the uppercase letters A-Z and the lowercase letters a-z, in that order. The length character uses the same table, so a full 45-byte line starts with h, and the empty line before end is a single +. Because the layout is identical, the output has the same size as uuencode: about 38% larger than the input, counting length characters and line breaks.
Why xxencode was created
Uuencode output is full of punctuation such as [, ], \, ^ and !. IBM mainframes use EBCDIC rather than ASCII, and these characters sit at different positions in different EBCDIC code pages. When mail passed through gateways between ASCII and EBCDIC networks, such characters could be translated wrongly and the file was corrupted.
Letters, digits, plus and minus are the same in every EBCDIC code page, so xxencoded text converts cleanly in both directions. MIME later reached the same goal: Base64 also uses only letters, digits and a few symbols that are identical in ASCII and EBCDIC. Xxencode never became as common as uuencode, and Base64 eventually replaced both.
Uuencode and xxencode side by side
| Uuencode | Xxencode | |
|---|---|---|
| Characters | ASCII 32 to 95, backtick for zero | + - 0-9 A-Z a-z |
| Full 45-byte line starts with | M | h |
| Last line before end | ` | + |
| Safe through EBCDIC gateways | No | Yes |
Specification
| Alphabet | + - 0-9 A-Z a-z |
|---|---|
| Output size | About 137% including line prefixes |
| Padding | Lines of up to 45 bytes |
| Standard | xxencode |
| Case sensitive | Yes |
Examples
| Input (UTF-8) | Output |
|---|---|
Hello, World! | begin 644 data.bin
BG4JgP4wg63RjQalY6E++
+
end |
Base64.is | begin 644 data.bin
7Ea3nNHMo9aZn
+
end |
你好 | begin 644 data.bin
4t9qUtOKx
+
end |
Frequently asked questions
How do I tell uuencode and xxencode apart?
h. Uuencoded lines contain punctuation and full lines start with M. If decoding here fails with an invalid character, try the uuencode page.Does the tool write the begin and end lines?
begin 644 with the file name you enter, and the closing lines. Turn the option off if you only need the encoded data lines.Can I decode a block without the begin line?
Yes. Without a begin line every non-empty line is decoded as data. With one, decoding starts after it and stops at the end line, so surrounding text is ignored.