XXEncode is a close cousin of uuencode, built to solve the same problem of moving binary through 7-bit text channels, but with an alphabet chosen to survive even hostile gateways. This tool encodes text into an xxencoded block and decodes blocks back to the original bytes, all in your browser.
How it works
XXEncode borrows uuencode’s exact framing: a begin 644 filename header, body lines of up to 45 source bytes, and an end trailer. For each three input bytes it forms four 6-bit values and looks each one up in the 64-character XX alphabet, which is +, -, the digits, and the upper- and lower-case letters. Every line starts with one alphabet character whose index equals the number of original bytes that line carries.
The crucial difference from uuencode is the alphabet. UUEncode’s mapping lands on many punctuation marks that some legacy mail systems silently rewrote. XXEncode deliberately uses only alphanumerics plus + and -, so a block could pass through those gateways without corruption.
The XX alphabet compared to UUEncode
Both formats pack three bytes into four characters using the same arithmetic, but the lookup table they use differs:
| Position | XX alphabet character | UUEncode character |
|---|---|---|
| 0 | + | space (ASCII 32) |
| 1 | - | ! |
| 2–11 | 0–9 | " through ) |
| 12–37 | A–Z | * through 9 and more |
| 38–63 | a–z | continued punctuation range |
UUEncode’s mapping starts at ASCII 32 (space) and runs through 95, which sweeps up characters like backtick, tilde, and many punctuation marks. Some EBCDIC gateways and early email relays rewrote those, silently breaking the block. XX’s tighter alphabet sidesteps the problem: +, -, digits, and letters all have stable representations in 7-bit ASCII across every gateway that mattered.
Anatomy of an xxencoded block
begin 644 example.txt
hJDDE5MDIFKSDLDM5AKLD
h+ABCD12345-abcde
`
end
begin 644 example.txt— the header.644is the Unix file permission in octal;example.txtis the decoded file name.- Each body line starts with a length character whose XX value is the number of original bytes on that line (1–45). The backtick line (
`, value 0) signals the end of data before theendtrailer. endcloses the block.
The decoder expects the complete framing. Text before begin or after end is ignored, which makes it safe to decode blocks cut from an email where surrounding message text is included.
When to use xxencode
XXEncode is a legacy format from the 1990s Usenet era. If you are:
- Recovering old Usenet archives or mailing-list archives — these frequently contain xxencoded attachments, particularly from gateways that stripped or corrupted UUEncode blocks.
- Working with a transport that still mangles punctuation — some industrial or embedded email relays still have this property.
For anything new, use MIME base64 (or just SMTP MIME attachments). XXEncode and uuencode are not interchangeable — they look similar but the alphabets differ, so decoding an xxencoded block with a uudecode tool will produce garbage. Make sure you identify which format your block uses before choosing a decoder.