Skip to content
Menu
Theme

Base64 Encode and Decode

Turn text into Base64 or Base64 back into readable text, with a URL-safe option and full support for accents and emoji. Free and private.

DeveloperRuns in your browser
Direction
Paste or type. The result updates as you type.

What is Base64?

Base64 is a way to write any data using only 64 plain characters: the letters A to Z and a to z, the digits 0 to 9, and two symbols, usually plus and slash. Every three bytes of input become four of these characters. The result is about a third longer than the original, but it can travel through places that only accept plain text.

You run into Base64 more often than you might think. Email attachments are sent this way. Small images get embedded in web pages as Base64. Login headers in web requests, tokens in configuration files and many API responses carry Base64 strings. When you need to read one of those strings, or build one by hand for a test, this tool does the conversion in a second.

Base64 is not encryption. Anyone can turn it back into the original, so never treat it as a way to hide a password or a secret. It only changes how the data is written, not who can read it.

The tool works with any language. Text is first turned into UTF-8 bytes, which is the standard on the web, so Vietnamese “Việt Nam” becomes “Vmnhu4d0IE5hbQ==” and comes back exactly the same when you decode it. Emoji work too.

There is also a URL-safe option for encoding. It swaps plus for a hyphen and slash for an underscore, and drops the equals signs at the end. That form is used in web addresses and in JSON Web Tokens, where the normal symbols would cause trouble. When you decode, both forms are accepted without any setting.

Everything runs in your browser. Your text is not sent anywhere and is gone when you close the page.

How to use the Base64 tool

  1. Choose whether you want to encode text or decode Base64. Encode is selected when the page opens.
  2. Paste or type into the input box. A short sample is there so you can see a result straight away.
  3. If you are encoding for a web address or a token, tick the URL-safe option.
  4. Read the converted text in the Result box. It updates as you type, so there is no button to press.
  5. Use the copy button under the result to put it on your clipboard.

If the text you are decoding is broken, a short message tells you what went wrong instead of showing nonsense.

FAQ

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

Base64 works on groups of three bytes. When the input does not split evenly into threes, the last group is padded and the equals signs mark that padding. The URL-safe option leaves them out, and the decoder works fine with or without them.

It says the text is not valid Base64. Why?

The input has a character that is not part of either Base64 alphabet, or its length cannot be a real Base64 string. Check that you copied the whole string and nothing extra, such as quote marks around it. Spaces and line breaks inside are fine and are ignored.

What does “not readable text” mean when I decode?

The Base64 was valid, but the bytes inside are not UTF-8 text. That usually means the string holds an image, a zip file or other binary data. This tool only shows text, so it stops there rather than printing garbled symbols.

Is Base64 safe for passwords?

No. Base64 is an encoding, not a lock. Anyone can decode it in a second with this very page. Use real encryption or a password manager for anything secret.

Is my text sent to a server?

No. The encoding and decoding happen inside the page on your own device. Nothing is uploaded and nothing is saved after you close the tab.

Related tools