Uuencode Encoder & Decoder
Encode data to the classic Unix uuencode format — complete with the begin mode/name header and end trailer — or decode a uuencoded block back into bytes. Uuencode is the binary-to-text scheme that carried attachments across email and Usenet before MIME and Base64. Provide the binary side as text or hex; everything runs live in your browser.
How to use the Uuencode Encoder & Decoder
Choose a direction. When encoding, pick whether your data is Text or Hex bytes, set a filename for the header, and the tool wraps the bytes in a full uuencoded block: a begin 644 filename line, the encoded body, a closing backtick line, and end. When decoding, paste a uuencoded block (with or without the begin/end lines) and the original bytes come back, shown as text or hex according to the data setting.
Each encoded line begins with a length character and then encodes three bytes into four printable characters. The classic example round-trips here: the three bytes of Cat encode to the line #0V%T. The tool accepts both the original space-padded form and the more common grave-accent (`) variant that maps the value zero to a backtick so trailing spaces are never stripped by mailers. The result card has a copy button.
It all runs in your browser, so encoding and decoding are instant, work offline, and nothing you enter is uploaded anywhere.
What uuencode is and why it existed
Uuencode — short for "Unix-to-Unix encode" — is a binary-to-text encoding created in 1980 as part of the UUCP suite that moved files between Unix machines over phone lines and, later, across Usenet and email. The problem it solved was fundamental to early networks: mail and news systems were built for text, and they would mangle or drop any byte outside the printable ASCII range. To send a program, an image, or any binary file, you first had to turn it into something that looked like ordinary text, ship that, and decode it on the far side. Uuencode was the dominant way to do this for well over a decade, until MIME and Base64 standardised the same idea more robustly in the 1990s.
The encoding itself is a close cousin of Base64. It takes the input three bytes at a time — twenty-four bits — and splits those bits into four groups of six. Each six-bit group (a value from 0 to 63) is turned into a printable character by adding 32, the ASCII code for space, so the output lands in the range of space through underscore. Every encoded line is prefixed with a single length character that encodes how many data bytes that line represents (up to 45), so the decoder knows exactly how many bytes to emit and can discard the padding on the final, short line. The whole stream is framed by a begin line carrying a Unix file permission mode and the original filename, and an end line, so the decoder can recreate the file with its name and mode intact.
One wrinkle drove a small but important variation. The original scheme encoded the value zero as a literal space, and many mail systems trimmed trailing spaces from lines, silently corrupting the data. The fix was to map zero to the grave accent (`, ASCII 96) instead, since 96 is 32 above 64 and decodes back to zero under modulo-64 arithmetic; this "grave variant" became the safer default, and decoders accept both. Uuencode is largely historical now — you will mostly meet it in old archives, Usenet posts, and legacy systems — but it remains a clean, compact illustration of how binary-to-text encoding works, and being able to decode a stray uuencoded block is still occasionally handy.
Common use cases
- Legacy archives. Decode uuencoded attachments from old email or Usenet posts back to their bytes.
- Retro computing. Produce a uuencoded block to feed an old Unix or UUCP-era tool.
- Learning. See how three bytes map to four printable characters, the same idea behind Base64.
- Debugging. Inspect the begin/end framing and per-line length bytes of a uuencoded stream.