B-Encoding (RFC 2047) Encoder

MIME header word encoding: =?UTF-8?B?...?= Base64 variant

Ad placeholder (leaderboard)

RFC 2047 B-encoding lets you put non-ASCII text into email headers using a Base64-wrapped encoded-word: =?UTF-8?B?...?=. It is the compact counterpart to Q-encoding and is preferred when most of the text is non-ASCII. This tool encodes and decodes B encoded-words in your browser.

How it works

The encoded-word format is =?charset?encoding?encoded-text?=. For the B encoding:

  1. The text is converted to UTF-8 bytes with TextEncoder.
  2. Those bytes are Base64-encoded using the standard alphabet A-Z a-z 0-9 + / with = padding.
  3. The result is wrapped as =?UTF-8?B?...?=.

Decoding reverses the process: the tool parses the charset and the B marker, Base64-decodes the body back to bytes, and runs a strict UTF-8 decode.

Tips and examples

The subject 日本語 (Japanese for “Japanese language”) encodes to =?UTF-8?B?5pel5pys6Kqe?=. Compared with Q-encoding — which would escape almost every byte as =XX — the Base64 form is noticeably shorter for this kind of text. Keep each encoded-word under 75 characters: the tool flags longer output, which a real mail client would break into multiple whitespace-separated encoded-words, each decoded independently.

Ad placeholder (rectangle)