Base64 Encoder

Paste text to encode it, or paste Base64 to read it. Accented letters and emoji work in both directions, and the URL-safe alphabet is one switch away for anything that travels in a link or a token.

Runs entirely in your browser. Your files are never uploaded.

How to use Base64 Encoder

  1. 1Paste your text or your Base64.
  2. 2Pick the direction, or let it guess from what you pasted.
  3. 3Switch on URL-safe if the value belongs in a URL or a token.
  4. 4Copy the result.

Why accents break elsewhere

The browser's own btoa function works on bytes and throws on any character above 255, which is why so many Base64 tools fail on the word café. Text here is converted to UTF-8 bytes first and read back the same way, so accents, Greek, Devanagari and emoji all survive the round trip.

Standard and URL-safe

Standard Base64 uses + and / and pads with =, all three of which mean something else in a URL. The URL-safe variant from RFC 4648 swaps in - and _ and drops the padding, which is what JSON Web Tokens and signed links use.

Decoding accepts either alphabet without being told, and it also accepts missing padding and line breaks, because that is how Base64 arrives when it has been copied out of an email header or a config file.

When the result is not text

Base64 encodes bytes, and plenty of those bytes are not characters. Decoding a PNG gives you a file, not a string, so the tool says how many bytes came out and that they are not text rather than printing a screenful of replacement glyphs.

Limits

  • Text in and text out. For encoding a whole file, the result would be a third larger than the file itself.
  • A JWT can be read here one part at a time, and the signature is not verified.
  • Decoding something that is not Base64 at all gives an error rather than a guess.

Frequently asked questions

Is Base64 a form of encryption?
No. It is an encoding that anyone can reverse in a second, which is what this page does. Use it to move bytes through a text-only channel, never to hide anything.
Can I read a JWT with this?
Yes, for the header and the payload. A JWT is three URL-safe Base64 parts separated by dots, so paste the middle part to read the claims. Verifying the signature needs the key and is a different job.
Why does my decoded text have strange characters?
Usually because the data was not text to begin with, or because it was encoded from a different character set. This tool tells you when the bytes are not valid UTF-8 instead of showing you broken glyphs.
What is the 76-character wrapping for?
MIME requires Base64 in email bodies to be wrapped at 76 characters per line. If you are pasting into a mail header or an S/MIME blob, turn it on. For everything else, leave it off.