Base64 encode and decode

  1. Choose file
  2. Set options
  3. Get result

Turn text or a file into Base64, or turn Base64 back into text or bytes. Padding is added when it is missing. URL-safe characters are accepted. The work stays in this tab.

Turn text or a file into Base64, and back

Base64 encode and decode uses the standard alphabet in this tab. Missing padding is added. A data URL loses the part before the comma. URL encode is a different page: it percent-escapes a query, it does not build this alphabet.

Text or a whole file

Encode a note or the bytes of a file. Decode as text only when the bytes are UTF-8. A PNG needs the file download, not the text box.

URL-safe characters count

Minus and underscore are accepted and turned into plus and slash. A length of 4n+1 is rejected. Other short strings get equals signs.

How to encode and decode Base64

  1. Choose Encode or Decode, then Text or File.

  2. Paste text, or choose a file when encoding a file.

  3. Press Convert. The result box is read-only.

  4. Copy the text, or download decoded bytes with the name you typed.

Base64 that never leaves the tab

  • Standard alphabet

    Plus, slash and equals, not a homemade variant.

  • Padding repaired

    A missing equals sign is added when the length allows it.

  • Files too

    A file encodes to text. Decode can download the bytes.

  • In this tab

    The text and the file are not sent to a server.

  • Read-only result

    You copy or download. The box does not pretend to be an editor.

  • No account

    There is no sign-up and no paid decode cap.

Questions about Base64

Why did a short string fail?

Length 4n+1 is never valid. Look for a dropped character.

Do - and _ work?

Yes. They are the URL-safe alphabet.

Can I paste a data URL?

Yes on decode. Everything through the comma is removed.

Is this URL encode?

No. URL encode percent-escapes text. Base64 maps bytes to 64 characters.

Why did text decode fail?

The bytes were not UTF-8. Download the file instead.

Does GustKit store the text?

No. Close the tab and the boxes are gone.