DO IT EASY APP
English

Base64 encode / decode

Encode text to Base64 or decode Base64 to text. Accented characters and URL-safe output included.

  • No sign-up, no fees.
  • Base64 encode and Base64 decode on one screen.
  • Accented characters and emoji come out right.
  • URL-safe format and = padding option.
  • Move the result to the input and flip direction with one click.
  • What you type is processed, but never shared with anyone.

Base64 decode: how to use the Base64 Encode / Decode Tool

Seen a meaningless string like SGVsbG8gd29ybGQh? It's most likely Base64. Five steps:

  1. Pick the direction. Encode or Decode.
  2. Paste the text. Type it into the Text to encode or Base64 to decode box. The result is prepared as you type.
  3. Set the options (when encoding). URL-safe (- _ instead of + /) and Add = padding.
  4. Flip (optional). The Move the result to the input and flip direction button puts the result into the input box and changes the direction; handy for trying to decode what you just encoded.
  5. Copy. Take the result with Copy.

What is Base64, and what isn't it?

Base64 is a way of writing any kind of data with only letters, digits and a few signs (+, /, =). Email attachments, images embedded in web pages, binary data in APIs and some config files use Base64 for that reason. Base64 encoding turns data into these characters, Base64 decoding makes it readable again. The size of the data grows by about a third.

It isn't encryption. Anyone can decode it; no key is needed. Turning a password into Base64 doesn't hide it; it only displays it differently. For real encryption there's AES-256 text encrypt / decrypt.

Accented characters

The text is first turned into bytes as UTF-8, then goes to Base64. That's why letters like "é ñ ü ç" and emoji are encoded correctly. If another tool wrote it with an old encoding, you may see garbled characters in the decoded text.

What gets cleaned when decoding?

Stray spaces and line breaks are ignored; the 76-character lines in emails cause no problem. If it starts with data:...;base64,, that part is dropped too. The URL-safe format with - and _, and the shortened form without =, are recognized.

Tips for a Base64 converter

  • An image? To turn a picture into Base64, Image to Base64 also gives ready HTML and CSS code.
  • A JWT? A three-part Base64 text separated by dots is a JWT; the JWT decoder shows the header and the content separately.
  • Is the decoded text JSON? Make it readable with JSON formatter and validator.

Common mistakes

  • Thinking Base64 is a password: "hiding" secret information with Base64 gives no protection.
  • Using normal Base64 in a URL: + and / cause trouble in an address; pick URL-safe or encode with URL encode / decode.

Frequently asked questions

Is converting Base64 free?

No cost at all. Not bad, right?

Is what I type saved?

The encoding happens in your browser. What you type is processed, but never shared with anyone.

Why did I get meaningless characters after decoding?

The data may not be text; it may be an image, a PDF or a compressed file. In that case you see a "not readable text" warning.

What are the "=" signs for?

They're padding; they round the length up to a multiple of four. Most programs decode without them, but some require them.

What does URL-safe mean?

The + and / in normal Base64 cause trouble in addresses. The URL-safe format uses - and _ instead. You see this format in JWTs.

Is Base64 secure?

No, it isn't encryption. Anyone can decode it.

Can I turn a file into Base64?

This tool works with text. For images there's Image to Base64.

Can I use it on my phone?

Yes. Paste the text, pick the direction and tap Copy.

Why does the text get longer when I encode with Base64?

Base64 writes every 3 bytes with 4 characters; the text grows by about a third. Accented letters are two bytes in UTF-8, so such texts grow a bit more.

Where do I run into Base64?

Attachments in the source code of emails, embedded images starting with data: on web pages, JWT session keys, authentication headers of some APIs (Basic Auth) and binary data in config files are written in Base64. If you see = or == at the end of a text, it's probably Base64.

How do I decode a Basic Auth header?

Copy the part after Authorization: Basic and paste it into Decode; it comes out as username:password. This also shows why Basic Auth should only be used over https.

Related tools