Base64 Encode/Decode

Turn text or a small file into Base64, or turn Base64 back into the original. Works with any language, including emoji, and with URL-safe Base64.

Use the tool

Loading the tool…

About Base64 Encode/Decode

Encode text or a file into Base64, or decode Base64 back into text or a file. Choose the direction, then paste the text or choose a file of up to 2 MB.

Worked example

Paste the text `Hello` and encode it. The tool shows its Base64 form, `SGVsbG8=`.

Limits

Base64 is an encoding, not encryption. Anyone can decode it, so do not rely on it to hide private data.

How to use Base64 Encode/Decode

  1. Choose Encode or Decode.
  2. Type or paste your text, or choose a file to encode.
  3. Set the options if you need them, then press Encode or Decode.
  4. Copy the result, or download the decoded file.

Good to know

  • Base64 is not encryption. Anyone can decode it, so never use it to hide a password or secret.
  • Text is saved as UTF-8, the usual standard on the web, so accents, other alphabets and emoji work.
  • When decoding, standard and URL-safe Base64 are both accepted, with or without = padding, and a leading data: prefix is ignored. Spaces and line breaks are ignored.
  • If the decoded data is not text (for example a picture), it is offered as a download.

Frequently asked questions

What is URL-safe Base64?

A version that uses - and _ instead of + and /, so it can sit in a web address or file name without changes.

Why does decoding say my text is not valid?

The message names the problem: a character that Base64 does not use, misplaced = padding, or a missing character.

Why is the file limit only 2 MB?

Base64 makes data about a third bigger, and showing very large text slows the page down.