uuencode encode & decode online

Encode or decode text with uuencode. No key needed, fully reversible, and nothing leaves your browser.

Runs in your browser
Line by line

How uuencode builds its lines

uuencode cuts the data into lines of up to 45 bytes. Each line starts with a character for its length (code minus 32, so M means 45), followed by 4 characters for every 3 bytes. A line with a single ` (zero bytes) ends the data.

LengthLine
+ = 11 bytes+:&5L;&\@=V]R;&0`
` = 0 bytes`

11 bytes in, 20 characters out: +82 %

Typing in the tool above fills this in. Nothing leaves your browser.

In short

What is uuencode?

uuencode ("Unix-to-Unix encoding") turns binary files into printable text for old mail and Usenet systems: lines of up to 45 bytes, each starting with a character that gives its length. It dates from 1980 and was replaced by Base64 in MIME e-mail. You still meet it in old archives, legacy systems and PHP's convert_uuencode().

Not encryptionAnyone can decode it, no key needed. It changes the format, not who can read it. Encoding vs hashing vs encryption →
Where you meet it
  • Old Usenet and mail archives
  • Legacy Unix scripts
  • Some mainframe and printer interfaces
  • PHP's convert_uuencode()
Check & decode

Why won't my uuencode decode?

Paste what you have. The check tells you what is wrong, what kind of data is inside and shows the decoded result.

Examples:
  • Paste text above or try an example.
Every form at once

With and without the file header

The same input in the forms you meet in practice. Shown for hello world; type in the box above or in the tool to use your text.

Data onlywhat the tool returns
+:&5L;&\@=V]R;&0` `
With file headerwhat uuencode and uudecode expect
begin 644 data.txt +:&5L;&\@=V]R;&0` ` end
Use it in code

The same result in your code

Every snippet encodes hello world to +:&5L;&\@=V]R;&0` ` exactly like the tool, then decodes it back. They are run and compared with the tool before each release.

PHP
echo convert_uuencode('hello world');
echo convert_uudecode("+:&5L;&\\@=V]R;&0`\n`\n"), "\n";
Python
import binascii

data = "hello world".encode()
lines = [binascii.b2a_uu(data[i:i + 45], backtick=True) for i in range(0, len(data), 45)]
print((b"".join(lines) + b"`\n").decode(), end="")

enc = "+:&5L;&\\@=V]R;&0`\n`\n"
print(b"".join(binascii.a2b_uu(l) for l in enc.splitlines() if l != "`").decode())

JavaScript, Java and Go have no built-in uuencode. On the command line, uuencode and uudecode come with the sharutils package.

Test values

uuencode examples and test values

What the tool returns for these inputs (UTF-8). Use them to check your own code. ↵ marks a line break.

Inputuuencode
a!80`` `
abc#86)C `
hello world+:&5L;&\@=V]R;&0` `
Grüße'1W+#O,.?90`` `
Common mistakes

Why your uuencode doesn't match

Where is begin 644?

The tool, like PHP's convert_uuencode(), returns only the data lines. The uudecode command expects begin 644 name before and end after them; the variants below show the full form.

M = 45 bytes

The first character of each line is its length: M stands for 45 bytes, a full line. A shorter last line has a smaller letter, and the line ` (0 bytes) ends the data.

Spaces or backticks

Old encoders wrote zero as a space, newer ones as `. Mail software often removes trailing spaces, which damages the old form. PHP and this tool use backticks.

begin-base64 is Base64

begin-base64 644 name looks like uuencode but the lines are Base64. Use the Base64 decoder for those.

The tool trims and uses CRLF

Like the form on the original site, the tool removes spaces and line breaks at the start and end, and sends line breaks as CRLF (\r\n). That is why a result can differ from your code by one line break.

FAQ

Questions about uuencode

Is uuencode still used?

Rarely. MIME e-mail replaced it with Base64 in the 1990s. You meet it in old Usenet and mail archives, some Unix scripts and legacy interfaces.

What is the difference between uuencode and Base64?

Both turn 3 bytes into 4 characters. uuencode uses the characters from space to `, which mail systems sometimes changed, and adds a length character per line. Base64 uses only letters, digits, + and /.

What does the M at the start of each line mean?

It is the line length: the character code minus 32. M (77) means 45 bytes, a full line. The last line ` stands for zero bytes and ends the data.

Good to know

Before you rely on it

Searches the list of pages on this site. What you type stays in your browser.