Base64 Encoder & Decoder

Text is turned into UTF-8 bytes before it is encoded, so non-English input never throws or comes back garbled. Decoding accepts standard, URL-safe and line-wrapped Base64 automatically and tells you exactly what is wrong when the input is not valid.

Runs in your browser Developer tools

Base64 result
The result appears here as you type.

Input - Output - Output / input -

Nothing leaves this page. Both directions run in this tab with the browser built-in TextEncoder and TextDecoder, and the only thing stored on your device is the three choices above.

How to use

  1. Choose Encode or Decode, then type or paste into the input box — or switch the source to File and pick a file, which is read in your tab and never uploaded.
  2. When encoding, pick the variant: standard with = padding, base64url (- and _, no padding) or MIME with 76-character lines. Decoding reads all three on its own.
  3. Read the result and the size note: the status line states how many bytes went in, how many characters came out and whether decoding the result again returns your input exactly.
  4. Use Copy result, Download .txt, or Wrap as data: URL to embed an image or file. If decoded bytes are not text, a hex byte view is shown instead of garbage.

Frequently asked questions

Why does btoa fail on Chinese or emoji?

The built-in btoa only accepts characters whose code is below 256, so anything outside Latin-1 throws an error, and a naive workaround returns mojibake when decoded. This tool encodes the text to UTF-8 bytes first and puts those bytes through Base64, then reverses the same steps, so any text survives the round trip.

What is the difference between standard, base64url and MIME?

They share the same data; only the spelling differs. Standard uses + and / with = padding. base64url swaps them for - and _ and drops the padding so the value is safe in URLs and JWTs. MIME is standard Base64 broken into lines of 76 characters, as used in email. Output is always about 4/3 the size of the input.

Is my text or file uploaded?

No. Both directions run in this tab using the browser’s TextEncoder and TextDecoder, and a file is read into memory locally. Only your three option choices are remembered on this device. Base64 is encoding, not encryption, so do not treat it as a way to hide secrets.

Guides

Related tools