Skip to content

Base64 encode and decode

Turn text into Base64 and Base64 back into text, with emoji and accented letters kept intact, then copy the result in one click.

  • Free
  • No account
  • Runs in your browser

Encode or decode Base64

Pick a direction and paste your text. The result updates as you type.

Result
TWVhZG93IERlc2sg8J+MsQ==

Everything stays in your browser. Nothing is sent or saved.

How to use the base64 encoder and decoder

  1. Choose Text → Base64 to encode, or Base64 → Text to decode.
  2. Paste your input. Spaces and line breaks inside Base64 are ignored when decoding.
  3. Copy the result. If the input isn’t valid Base64, the tool says so instead of guessing.

How the base64 encoder and decoder works

Base64 writes any bytes with 64 safe characters: A to Z, a to z, 0 to 9, + and /. The tool first turns your text into UTF-8 bytes, so emoji and accented letters survive, then writes every 3 bytes as 4 characters. One or two = signs at the end pad the last group.

Encodetext → UTF-8 bytes → Base64
Length4 characters for every 3 bytes, rounded up
DecodeBase64 → bytes → UTF-8 text

The browser’s own btoa function accepts only the first 256 Unicode characters, so an emoji or a Greek letter makes it fail. Going through UTF-8 bytes in both directions is what makes this tool safe for text in any language.

Worked example: the tool’s starting text
Text
Meadow Desk 🌱
UTF-8 bytes
16, of which the seedling emoji takes 4
Base64 length
16 bytes ÷ 3, rounded up, × 4 = 24 characters
Base64
TWVhZG93IERlc2sg8J+MsQ==

The two = signs are padding: 16 bytes is one more than a multiple of 3, so the last group of 4 characters carries a single byte.

Base64 encoder and decoder FAQ

Is Base64 encryption?

No. Anyone can decode it in a second, with no key. It only makes data safe to carry through systems built for plain text. Never use it to hide a password: if one was shared in Base64, treat it as exposed and make a new one with the password generator.

Why is the Base64 version longer?

It uses 4 characters for every 3 bytes, so it comes out about a third bigger than the original, plus up to two = signs. Paste both into the word counter to see the difference. That is the price of fitting any data into plain text.

Why does my Base64 not decode?

Usually it uses the other alphabet: Base64url writes - and _ where Base64 has + and /. Swap them back and try again. If it came from a link it may also be URL-encoded, with %2B and %3D in place of + and =. And it has to decode to text: a Base64 image or file won’t show here.

How do I read a JSON Web Token?

A JWT is three Base64url parts joined by dots. Paste the middle part here, with - and _ swapped for + and /, and you get JSON that the JSON formatter lays out. Its exp field is a Unix timestamp: the moment the token stops working. Reading a token is not checking its signature.

Where is Base64 used?

Email attachments, images embedded in a web page or a CSS file as data URIs, API keys in HTTP sign-in headers, and anywhere else binary data has to travel as plain text.

Like the tools? Meet the desk.

Sign-ups are paused for now. Save your seat and we'll email you the moment they reopen.

See pricing