Uuencode and uudecode online
Paste text or hex bytes to uuencode them, with or without the begin and end lines, or switch to Decode and paste a uuencoded block — from an old e-mail, a Usenet post or a shell archive — to get the content back.
Runs in your browser: nothing you enter is sent anywhere.
How to use it
- Choose Encode or Decode.
- Encoding: type text, or set Bytes as to Hex bytes and paste hex. Keep Add begin/end lines for a complete block (begin 644 file.txt … end), or turn it off for the data lines alone.
- Decoding: paste the block. Text before begin and after end is ignored, so you can paste a whole message.
How it works
Each group of 3 bytes (24 bits) is split into four 6-bit values. Each value v is written as the character with code 32 + v, except that 0 is written as a backquote `. A line starts with one length character (32 + number of bytes) and holds at most 45 bytes, which is 60 data characters. A short final group is padded with zero bytes; the length character tells the decoder how many bytes are real.
Worked example
The text Cat is the bytes 43 61 74:
- in bits: 010000 110110 000101 110100 = 16, 54, 5, 52;
- adding 32: 48, 86, 37, 84 = 0 V % T;
- the line holds 3 bytes, so it starts with 32 + 3 = 35 = #.
The full block is:
begin 644 file.txt
#0V%T
`
end
Tips
- If decoding fails, check that the block was not reflowed: every line must start with its length character.
- The 644 in the begin line is the Unix file permission; the decoder here ignores it and the file name.
- For new work, Base64 is more widely supported than uuencoding.
Frequently asked questions
What is uuencoding?
Unix-to-Unix encoding, a way to send binary files over channels that only carry text, such as early e-mail and Usenet. Every 3 bytes become 4 printable characters, lines carry up to 45 bytes, and the block is wrapped in a begin line (permissions and file name) and an end line.
Why do some uuencoded files use spaces and others backquotes?
The value 0 was first written as a space (code 32). Spaces at the end of lines were often stripped by mail systems, so later encoders, including GNU sharutils, write a backquote ` instead. The decoder reads both, because it takes the character code minus 32 and keeps the low 6 bits.
What is the first character of each line?
The number of bytes on that line, plus 32. M means 45 bytes (77 − 32), the usual full line; a shorter last line starts with a different letter, and a line with just ` (zero bytes) comes before end.
Can it decode begin-base64 blocks?
No. uuencode -m writes Base64 inside begin-base64 … ==== lines; that is plain Base64, so decode its body with a Base64 decoder instead.