b2KIT

UUEncode / UUDecode Tool

Encode and decode files using UUEncoding, a legacy binary-to-text encoding for email.

Tested tool guide Tested browser tools Checked August 16, 2026

What UUEncode / UUDecode Tool does, with a checked example

UUencoding turns a file into plain ASCII: bytes are sliced into 6-bit chunks, each shifted up by 32 so every output character lands in the printable range space through underscore. Three input bytes become four characters, so the encoded text runs about 33 percent larger than the original. Paste text or a small file and the page emits the encoded form inside its begin and end lines; paste uuencoded text and it emits the restored bytes. Everything runs in the page, so nothing is uploaded. The surprise: base64 replaced this 1980s email format long ago, so you are most likely decoding old Usenet data, not data you made today.

Worked example

A concrete input and expected output from the current implementation.

Input

Cat (text to encode, with file name cat.txt and mode 644)

Expected output

begin 644 cat.txt
#0V%T
`
end

Cat is the three bytes 0x43 0x61 0x74; joined, their 24 bits split into 010000 110110 000101 110100, and adding 32 to each group yields the characters 0, V, %, T. The leading # is the line-length character, 3 bytes plus 32, and the envelope carries the mode and name a decoder needs to recreate the file.

How the result is produced

1

Three bytes become four characters

Three bytes are read at a time, joined into 24 bits, and cut into four 6-bit values. Adding 32 to each value maps it to a printable character in the range space through underscore. Every line starts with a length character equal to its raw byte count plus 32, so a full 45-byte line always begins with M; a final line of 1, 2, or 3 bytes yields 2, 3, or 4 characters. Decoding subtracts 32, reassembles the groups, and discards the padding bits of the last character.

2

The begin and end envelope

Encoded output is wrapped in begin <mode> <filename> and a closing end line. The mode is a Unix permission value such as 644, and the name is the original file name, which the decoder restores on output. A terminator line marks the end of data: a single space in the original format, a lone backtick in the modern variant, and decoders accept both. Pasting only the data lines, without the envelope, loses the file name.

Good uses

  • Extracting a file from an old Usenet post or mailing-list archive, where pre-MIME binary attachments were uuencoded into the message body.
  • Recovering a file that reached you as pasted text through a 7-bit-only channel, such as an old mail gateway or bulletin board, by decoding it back to bytes.
  • Decoding legacy exports, backups, or vendor files that still use uuencode rather than base64, and re-encoding bytes when a legacy system demands that format.

Limits and checks

  • Encoded output is bigger, not smaller: 3 bytes become 4 characters, plus a length character per line, so uuencoded text runs about a third larger than the original. If the goal is shrinking data or sending an attachment today, this is the wrong tool; that is what base64 or compression is for.
  • Only uuencoded text decodes: base64, quoted-printable, and yEnc use different alphabets and rules, and this tool does not translate between them. Feed it the full begin/end envelope, and only text whose transport kept it intact, since re-wrapped or trailing-space-trimmed lines corrupt the line-length characters.
  • Decoding is byte-exact, but the paste path can lose fidelity: text boxes often normalize CRLF to LF, so a Windows-encoded text file pasted for decoding comes back with Unix line endings. And if only the data lines were preserved, the begin line's file name and mode are gone.

Common questions

Why does almost every line of my output start with M?

Because M is the length character for a full line. Each line carries 45 raw bytes, and the length character is the byte count plus 32, so 45 + 32 = 77, which is the ASCII code for M. It is not a marker or a header; only the final, shorter line starts with a different character. Any uuencoder producing full lines will show this.

Is uuencode still used today, or should I use base64?

For new work, no: the base64 encoding that MIME standardized in the early 1990s, now documented in RFC 4648, replaced uuencode for email attachments, and modern mail clients do not treat uuencode as an attachment format. Uuencode survives only in legacy files and archives. If you are encoding data for a current system, use base64; reach for this tool when you have old uuencoded data to decode.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools