Base64 Encoder & Decoder

Base64 made practical: encode, decode, and ship

If you work with APIs, emails, tokens, or tiny file embeds, you’ve met Base64. It’s a compact way to turn raw bytes into plain text so data can travel through places that only speak text. This page focuses on getting that job done quickly and safely: paste plain text on the left to encode, or drop a Base64 string on the right to decode. Everything runs locally in your browser — there are no uploads, no background requests, and no sign‑ups.

The encoder is UTF‑8 aware, so accents, scripts, and emoji round‑trip cleanly. Switch to the URL‑safe flavor when you’re placing values in query strings or filenames; remove = padding if your consumer supports it; and fold lines at 64 or 76 characters to match common conventions (76 is the MIME standard used in many mail systems). The decoder is forgiving: it trims whitespace, accepts URL‑safe input, restores missing padding, and can extract the payload from a full data URL.

How to use the Base64 Encoder & Decoder

  1. Enter your input
    Type or paste plain text on the left to encode, or a Base64 string on the right to decode.
  2. Choose options (optional)
    Toggle URL‑safe, Remove padding, and pick a line width (None, 64, or 76 for MIME).
  3. Copy / Upload / Download
    Use Copy on any panel, Upload a .txt to either side, or Download the current content.
  4. Fix invalid inputs
    Base64 works in blocks of four. If the length looks wrong, remove stray characters or paste the full data URL so the tool can extract the payload.

Guide

Where this helps: tokens in headers or cookies, small payloads in query strings, email bodies that need MIME‑safe wrapping, and debugging opaque blobs from a log or webhook. Paste, decode, and see what’s really inside — without round‑tripping through another site.

What Base64 is — and isn’t: it’s an encoding scheme, not a cipher. It’s about making bytes safe for text pipelines, not about secrecy. If you need confidentiality, use encryption. For percent‑encoding of URLs, head to URL Encoder/Decoder. Working with JSON? Use JSON Formatter to inspect payloads. Sharing links? The QR Code Generator turns them into scannable codes in seconds.

Key features

  • UTF‑8 safe encoding and decoding (emoji and non‑ASCII round‑trip correctly).
  • URL‑safe variant replaces + and / with - and _ for filenames and tokens.
  • Optional removal of trailing = padding when your consumer allows it.
  • Line folding at 64 or 76 characters (76 is the MIME standard used in emails).
  • Decoder accepts full data URLs, trims whitespace, restores padding, and accepts URL‑safe input.
  • Per‑panel Upload and Download, one‑click Copy, Swap panels, and optional line wrapping.
  • Runs entirely in your browser — no uploads, no tracking.

Tips

  • Prefer URL‑safe + no padding for query strings, cookies, and filenames.
  • Keep padding if you’re unsure — some decoders expect it.
  • Use 76‑character lines for MIME email bodies; 64 is common in PEM‑style blocks.
  • If you see an error, remove stray characters and make sure the length is a multiple of 4. Padding fixes 2/3 remainders.
  • Base64 is encoding, not encryption. For secrecy, use a proper encryption tool.

Frequently asked questions

Is Base64 encryption?
No. Base64 doesn’t hide meaning — it just represents bytes as text. If you need confidentiality, use an encryption tool instead.
What is URL‑safe Base64?
A variant that swaps +// for -/_. It’s safer for URLs and filenames, and many systems omit the trailing = padding.
Why do I see '=' at the end?
That’s padding to ensure the length is a multiple of 4. Some decoders require it; keep it unless your consumer explicitly supports no‑padding.
Can I decode a full data URL?
Yes. Paste the entire string (for example, data:…;base64,XXXX). The tool extracts the Base64 automatically.