123024.com · Base64

Base64 Encode / Decode

Base64 represents binary data with 64 printable characters. You will see it in email attachments, Data URLs, some HTTP headers, and whenever binary needs to sit safely inside a JSON string. It is not encryption — anyone can decode it, so it is not a secrecy mechanism.

Why Base64

Many protocols and text formats can only reliably carry ASCII printable characters. Base64 maps arbitrary bytes to A–Z, a–z, 0–9, +, / (and padding =), so invisible bytes do not break text transport.

This tool treats text as UTF-8, so Chinese, emoji, and similar content encode and decode correctly. After you stop typing, it tries to detect plain text vs Base64 and convert accordingly.

Caveats

URL contexts sometimes use Base64URL (- and _ instead of + and /, padding optional). If decode fails, check whether you have a URL-safe variant. Do not treat Base64 alone as “encrypted storage” for tokens or passwords.

Tips

  • Base64 grows size by about 33% — not ideal for repeatedly converting huge files in a page.
  • For strings starting with data:image/png;base64,, strip the prefix before decoding the image bytes.