yEnc Decoder

Paste a yEnc-encoded string to decode it.

Result

HELLO
5 bytes
Decoded as text.
No =ybegin header: decoded as a bare fragment, so size and CRC32 could not be checked.

How it is calculated

When the text has a =ybegin header, the decoder takes only the lines between it and the =yend trailer as data, as the yEnc draft 1.3 asks (“yDecoder implementations must ignore any text outside the header/trailer blocks”); a =ypart line is metadata. Without a header the whole text is decoded as a bare fragment. The data lines are joined, because line breaks are not data. It reads the text one character at a time. A normal character with code c becomes the byte (c − 42) mod 256. The escape character = takes the next character with code c and turns it into (c − 64 − 42) mod 256; this is how bytes that would be troublesome in text (such as NUL, LF, CR and = itself) are carried. A lone = at the very end is ignored. If the resulting bytes are valid printable text, it shows that text; if they contain control characters or invalid UTF-8, it shows the bytes as space-separated hex pairs instead. The tool also reports the byte count and checks integrity as the draft says: the size in the header, the size in the trailer and the decoded size must agree (for one part of a multi-part post, the trailer size, the =ypart begin–end range and the decoded size), otherwise it warns that the attachment is corrupt; when the trailer gives crc32 (or pcrc32 for a part), it compares the CRC32 of the decoded bytes with it. It does not read the filename.

Worked example

Paste the encoded text rovvy. Each letter has its code lowered by 42: r (114) gives 72, o (111) gives 69, v (118) gives 76 twice, and y (121) gives 79. The byte values 72, 69, 76, 76, 79 are the letters H, E, L, L, O. They contain no control characters, so the tool shows them as text: HELLO, with a count of 5 bytes. Data from a real file usually contains control or non-text bytes, so it will normally be shown as hex.

Try this example →

Common mistakes

  • Expecting a downloadable file. The tool is for a short fragment that you read as text or hex; a binary file such as an image comes out as a hex list, not as a file.
  • Putting a space or other character before the header word. Only a line that begins exactly with “=ybegin ” starts a block, so “ =ybegin” with a leading space is not seen as a header, and the whole text is decoded as a bare fragment with meaningless bytes.
  • Using text that was copied through a program that changed the characters, for instance a mail client replacing non-ASCII bytes or trimming spaces. A single changed or missing character shifts or corrupts the output.
  • Dropping the = escape in front of a character. A lone = consumes the next character, so deleting or adding one shifts the meaning of the character after it.
  • Confusing yEnc with Base64. They are different formats; Base64 text will decode into unrelated bytes here, though the tool will not warn you. A bare fragment with no header has no size or CRC32 to check, so corruption in it goes unnoticed.

Sources

About this calculator

yEnc is a binary-to-text encoding scheme designed specifically to post binary files (images, video, archives) to Usenet more efficiently than older methods. Where Base64 or uuencode inflate a file's size by roughly 33-40% because they map raw bytes into a restricted printable-ASCII alphabet, yEnc instead shifts each byte's value by 42 (mod 256) so that most bytes land directly in the printable range, escaping only the handful of bytes (like NUL, LF, CR, and the “=” escape character itself) that would otherwise break line-based text transport — keeping overhead down to roughly 1-2%.

This decoder handles that core “=” escape mechanism, converting a yEnc-encoded string back into text or hex, and follows the yEnc draft 1.3 for the =ybegin/=ypart/=yend lines that a full Usenet binary post uses: it decodes only the data between the header and the trailer, ignores text outside them, and checks the sizes and the CRC32 checksum they give, warning when they do not match; it does not read the filename. It's a useful tool for anyone building or debugging Usenet newsreader software, or decoding a yEnc-encoded fragment by hand.

Was this helpful?

You can pick up to 3 reactions.

Comments

  • Be the first to comment.

Popular calculators

All Calculators