Base64 Encoder & Decoder

Encode and decode Base64 in your browser — text, files, URL-safe, MIME line wrap and data URLs. UTF-8 correct, no uploads, no size limit.

Runs in your browser

Text or any file type — files are read in this tab with the File API, so nothing is uploaded.

Result

Type or paste text to encode it.

How to use

  1. Pick the Text tab for strings, or the File tab to drop a file and get its Base64.
  2. Choose Encode or Decode, then type or paste into the input box.
  3. Tick ‘URL-safe (Base64URL)’ for tokens, or set Line wrap to 64 or 76 characters for MIME.
  4. Paste a JWT to see its header and payload decoded, or a data: URL by ticking the prefix box.
  5. Copy the result, use ⇄ Swap to feed it back in, or press ‘Download .txt’ / ‘Download as file’.

FAQ

Are my files uploaded when I Base64-encode them?

No. The file is read with the browser’s own File API and encoded in this tab. base64encode.org, by contrast, POSTs every file and every non-UTF-8 option to their server. Ours never leaves the page — check DevTools → Network.

What is URL-safe Base64 (Base64URL)?

RFC 4648 §5 replaces + with - and / with _ so the value is safe in URLs and filenames, and usually drops the = padding. JWTs use it. Toggle "URL-safe" and we handle padding for you; on decode we accept both variants automatically.

Why does decoding fail on text I copied from a terminal?

Copied Base64 usually carries newlines, and atob rejects any character outside the alphabet — including \n. We strip whitespace, convert URL-safe characters and re-pad before decoding, then tell you the exact character and position if something is still wrong.

Related tools

More Developer tools: Developer