Upload a file
  1. base64hub
  2. Other bases
  3. Uuencode

Uuencode and Uudecode Online Converter

Type text to get classic uuencoded output with begin and end lines. Flip the direction to uudecode: paste a whole message, and the decoder finds the begin line, decodes the block and offers the file under its original name.

Free no sign-up, no limits Local nothing uploaded File name read from the begin line Updated Oct 27, 2026
Input 0Bytes 0 BOutput 0

Processed in your browser. This page cannot send your data anywhere – how we know

How to uuencode and uudecode

To encode:

  1. Type or paste text into Input · Text. The uuencoded block appears in Output · uuencode.
  2. Set the File name under the output; it goes into the begin line. The default is data.bin.
  3. Untick begin/end lines if you need only the encoded lines, for example to embed them in another format.

To decode:

  1. Click uuencode → Text in the direction toggle.
  2. Paste the uuencoded data. It can include the mail or news text around it; everything before the begin line is skipped.
  3. Read the text in the output, or click Save bytes to download the decoded file under the name from the begin line. For binary content, set To to Hex to inspect it first.

Anatomy of a uuencoded file

Encoding the text Cat with the file name hello.txt gives:

begin 644 hello.txt
#0V%T
`
end
  • begin 644 hello.txt gives the Unix permissions and the file name.
  • Each data line starts with a length character: the number of bytes on the line plus 32. # is 35, so this line holds 3 bytes. A full line holds 45 bytes and starts with M, followed by 60 characters.
  • The data characters work much like Base64: every 3 bytes become four 6-bit values, and each value v is written as the character with code v + 32. A value of 0 is written as a backtick instead of a space.
  • The line with a single backtick is an empty line of length 0, and end closes the block.

A longer input shows the full-line structure:

begin 644 fox.txt
M5&AE('%U:6-K(&)R;W=N(&9O>"!J=6UP<R!O=F5R('1H92!L87IY(&1O9RX@
*,#$R,S0U-C<X.0``
`
end

That is The quick brown fox jumps over the lazy dog. 0123456789: 45 bytes on the M line and 10 on the * line (42 − 32 = 10). Every line carries its own length plus a newline, so uuencoded data is about 38% larger than the input, a bit more than Base64.

Where uuencode still turns up

uuencode comes from Unix-to-Unix Copy (UUCP) and was the standard way to send binary files through email and Usenet before MIME. Today you meet it in old mail archives, Usenet posts, some embedded and mainframe file transfers, and scripts that pipe files into mail.

The backtick convention dates from that era. Some gateways stripped trailing spaces from lines, which destroyed data encoded with space for zero; the backtick survives. This encoder writes backticks, and the decoder accepts both.

Uuencode on the command line and in Python

With GNU sharutils installed:

uuencode hello.txt hello.txt > hello.uu
uudecode hello.uu

The first argument is the input file and the second is the name written into the begin line. uudecode creates the file with that name in the current directory. Add -m to uuencode for Base64 output instead.

In Python, binascii encodes one line of up to 45 bytes at a time:

import binascii

binascii.b2a_uu(b"Cat", backtick=True)   # b'#0V%T\n'
binascii.a2b_uu(b"#0V%T")                # b'Cat'

Add the begin 644 name line, the closing backtick line and end yourself. More encoding examples are on the Python page.

Common problems

  • An error at position 1. There is no begin line and the text is not bare uuencoded lines either. Check that you copied the whole block.
  • Garbage output from a begin-base64 block. That block was written by uuencode -m and is Base64. Copy the lines between begin-base64 and ==== into the Base64 decoder.
  • The file is truncated or has wrong bytes near line ends. A mail client re-wrapped the lines or stripped trailing spaces. Every data line must be intact; try to get the original attachment or message source.
  • A multi-part post decodes only partly. Large files were often split across several messages. Join the parts in order, keeping one begin and one end, before decoding.

FAQ

How do I fix uuencode: command not found?

The command is not installed by default on most Linux systems. On Debian and Ubuntu, sudo apt install sharutils adds uuencode and uudecode; Fedora has a sharutils package as well.

What does begin 644 mean?

644 is the Unix file mode the decoded file should get (owner read/write, everyone else read), and the word after it is the file name. uudecode creates that file; this page uses the name for Save bytes.

Is uuencode the same as Base64?

Both turn 3 bytes into 4 characters, but uuencode uses the ASCII range from space to underscore and adds a length character per line. Base64 has a different alphabet and is what MIME email uses. uuencode -m writes Base64 inside a begin-base64 block.

Can Python still decode uuencoded files?

Yes, with binascii.a2b_uu, one line at a time. The higher-level uu module was deprecated in Python 3.11 and removed in 3.13.