Skip to main content
ToolNestora

Base64 Encoder and Decoder

Turn text into Base64 or turn Base64 back into text. Accented letters, emoji and other scripts are handled correctly because the text is converted to UTF-8 first. You can produce the URL-safe form, break long output into lines, and decode data that was written either way.

Encode or decode Base64

What do you want to do?

Text is converted to UTF-8 first, so accents, emoji and other scripts work.

Uses - and _ instead of + and /, and leaves off the = padding.

The MIME e-mail convention. Most other uses want one long line.

How to use it

  1. Choose encode or decode

    Select “Encode text to Base64” to convert plain text, or “Decode Base64 to text” to read Base64 you have been given.

  2. Paste your input

    Type or paste into the first box. When decoding, spaces, line breaks and a leading data: URL prefix are ignored.

  3. Set options

    When encoding, tick URL-safe Base64 for the - and _ alphabet without padding, or line breaks at 76 characters for the e-mail convention.

  4. Copy the result

    Copy it or download it. “Use result as input and switch” lets you check a round trip.

Example: reading a Base64 value from a configuration file

A configuration file contains the value SGVsbG8sIHdvcmxkIQ==. Choose Decode, paste it, and the result reads “Hello, world!”. If the decoded bytes are not text, for instance because the value is an image, the tool says so, shows the first bytes and offers the raw data as a download instead of printing nonsense.

Standard and URL-safe Base64

Both forms encode the same bytes. They differ in two characters and in padding.

Comparison of the standard and URL-safe Base64 alphabets
FormCharacters 62 and 63PaddingTypical use
Standard+ and /= added so the length is a multiple of 4E-mail, data: URLs, many APIs
URL-safe- and _Usually left offWeb tokens, file names, values inside URLs

Limits and limitations

  • Base64 is an encoding, not encryption. Anyone can decode it, so it does not protect secrets.
  • Base64 makes data about one third larger.
  • This tool encodes text. It does not read files, so images and other binary files cannot be converted to Base64 here.
  • When decoding, the result is shown as text only if the bytes are valid UTF-8. Text saved in another encoding can appear as binary data.
  • Missing = padding is accepted when decoding, with a note. Mixed standard and URL-safe characters are rejected.

Frequently asked questions

Is my text uploaded?

No. Your text is processed by JavaScript running in your browser and is not sent to a server. The page itself still loads from a web server like any website. This site can load advertising or analytics scripts, but only after you accept them in the cookie notice. They are separate from the tools, which never pass the files or text you work with to them.

Why does decoding say my data is not text?

Base64 can carry any bytes. If the decoded bytes are not valid UTF-8 text, the data is probably a file such as an image or a compressed archive. You can download the raw bytes.

What is the difference between standard and URL-safe Base64?

Standard Base64 uses + and /, which have special meanings in URLs. The URL-safe form swaps them for - and _ and normally omits the = padding. The decoder accepts either.

Why does the encoded text end with = signs?

Base64 works in groups of three bytes. When the data does not fill the last group, one or two = signs pad the output to a multiple of four characters.