Base64 Encoder & Decoder

Turn text into Base64, or read Base64 back as text. Emoji and Indian languages work, URL-safe output is one tick, and nothing is uploaded.

Result


          

0Characters in
0Characters out
0Bytes of data

How to use it

  1. Choose Encode to turn text into Base64, or Decode to read Base64 back as text.
  2. Paste into the left box. The result appears as you type — there is no button to press.
  3. Copy the result, or send it back as input to check that it round-trips to exactly what you started with.

What Base64 is for

Base64 exists because a lot of the internet was built to carry text, not arbitrary bytes. An email body, a JSON field, a URL, an XML attribute, a data: image inside a stylesheet — all of them are text channels. Base64 takes any run of bytes and rewrites it using 64 characters that survive every one of those channels unharmed.

It works three bytes at a time. Three bytes are 24 bits; 24 bits split evenly into four groups of six; and six bits can count to 64, which is where the name comes from. That is also why the result is always about a third longer than what went in, and why it often ends with one or two = signs: those mark that the last group was not a full three bytes.

This page encodes through UTF-8, so a rupee sign, an emoji or a line of Telugu encodes and decodes back exactly as typed. The browser's own btoa() cannot do that on its own — it refuses anything above U+00FF — which is why so many pages quietly mangle non-English text.

Frequently asked questions

Is Base64 encryption?

No, and this is the mistake that matters. Base64 is an encoding, not a cipher: there is no key and no secret. Anyone who sees the string can paste it into a page like this one and read it back in a second. Never use it to hide a password, a token or anything private.

Why is my Base64 longer than the text I put in?

Because every three bytes become four characters, the result is about 33% larger, plus padding. That is the price of getting bytes through a channel that only accepts text, and it is why sending a large file as Base64 inside JSON is usually a bad idea.

What is URL-safe Base64?

Standard Base64 uses + and /, and both mean something else in a URL: + can be read as a space and / separates path segments. URL-safe Base64 swaps them for - and _ and usually drops the = padding. JSON Web Tokens use exactly this variant, which is why a JWT has no plus signs in it.

Why does my Base64 end in one or two equals signs?

That is padding. Base64 works on groups of three bytes; if the data does not divide evenly, the last group is short and = marks how short. One = means the data ended one byte shy of a group, two = means two bytes shy. This page adds the padding back automatically when you decode, so you can paste a string that has had it stripped.

Can I decode a Base64 image or PDF here?

You can paste it, but this is a text tool: it will tell you the data is not text rather than show you a wall of broken characters. It also reports how many bytes the data actually is, which is often the thing you wanted to know.

Is my text sent anywhere?

No. Everything happens in JavaScript inside your own browser. Nothing is uploaded and nothing is saved - close the tab and it is gone.

Related tools