XXencode and XXdecode — letters, digits, plus and minus only

XXencode wraps text in a begin … end block like uuencode, but uses only letters, digits, + and - so it survives systems that alter punctuation. Encode text, or paste a block to decode it.

Live demo · real result from this tool
Direction

Encoded

begin 644 message.txt1Eq3o+end

Processed on your device — nothing is uploaded.

How to use the XXencode tool

  1. Set Direction to Encode or Decode.
  2. To encode, paste text into Input and set File name in the begin line (default message.txt).
  3. To decode, paste the whole block from begin to end.
  4. Copy the result. Bytes that are not valid UTF-8 text are shown as hex.

What it does and when to use it

XXencode was a fix for a practical problem in the 1980s and 1990s: files sent by email were damaged when they passed through gateways that rewrote certain punctuation. By limiting itself to letters, digits, + and -, XXencode avoided the characters most likely to be changed.

Today you mostly meet it in archives of old Usenet posts and mailing lists, in retro computing, and in tests for decoders that support several legacy formats. Use this tool to read such a block or to produce one for testing.

It is the sibling of uuencode, which uses the same structure. For new work, Base64 is the standard choice; its alphabet is very close to XXencode’s, with + and / instead of + and -, in a different order. If you only need a compact, letters-and-digits form, see Base62.

How it works

  1. Text becomes UTF-8 bytes, split into lines of at most 45 bytes.
  2. Each line starts with a character for its byte count, looked up in the table +-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz. 45 bytes gives h; 3 bytes gives 1.
  3. Every 3 bytes become four 6-bit values, each written with the same table. A short final group is filled with zero bytes.
  4. A line containing only + (zero bytes) is written, then end.

The decoder finds the begin line, reads each line’s byte count, converts the characters back and drops the filler bytes. Everything runs in your browser.

Worked examples

Cat  (Encode)
begin 644 message.txt
1Eq3o
+
end

“Cat” is 3 bytes, so the line starts with 1, the table entry for 3, followed by four data characters. Compare uuencode, which writes the same bytes as #0V%T.

Hello, world!  (Encode, file name hi.txt)
begin 644 hi.txt
BG4JgP4wg65RjQalY6E++
+
end

B is the table entry for 13, the number of bytes. The two + signs at the end of the data line encode zero filler bits, because 13 bytes do not divide evenly into groups of 3.

Limits and tips

  • The tool works with text you paste and shows results on screen; it does not open or save files.
  • The permission field is always written as 644. The file name only labels the block; it does not affect the data.
  • A line starting with a character outside the table, or worth more than 45, is reported with its line number.

Frequently asked questions

Why was XXencode created?
Uuencode uses almost every punctuation character, and some old mail gateways, especially those that converted between ASCII and EBCDIC on mainframes, changed or dropped some of them. XXencode uses only 64 characters that pass through such systems safely.
How is XXencode different from uuencode?
The layout is the same, with a begin line, data lines of up to 45 bytes and an end line. Only the alphabet differs. Uuencode writes value v as the character with code 32 + v, while XXencode looks v up in the table +, -, 0–9, A–Z, a–z.
Can I decode a uuencoded block here?
No. The alphabets are different, so a uuencoded block gives an error or wrong bytes. Use the uuencode tool for those. If you are not sure which one you have, look for punctuation such as quotes, semicolons or backticks, which only uuencode uses.
What does the + line at the end mean?
It is a data line holding zero bytes, because + stands for the value 0. It marks the end of the data, just before the end line.
Is XXencoded text secret?
No. It is an encoding that anyone can reverse. It has no key and no encryption.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close