Base64 encoder and decoder

Text to Base64 and back, plus data URLs for files. URL-safe variant included.

Mode
 
Or a file

Base64 exists because some systems only carry text: email attachments, JSON payloads, data URLs in CSS, tokens in a URL. It turns any bytes into letters, at the cost of making them a third larger.

Paste text to encode it, paste Base64 to get the text back. The URL-safe switch produces the variant that uses - and _ instead of + and /, which is what JWTs and query strings need.

Files can be encoded too, as a complete data URL ready to paste into HTML or CSS — useful for embedding a small icon without a second request.

How to use it

  1. Paste your text (or Base64).
  2. Choose encode or decode, and URL-safe if you need it.
  3. Copy the result, or pick a file to get a data URL.

Frequently asked questions

Is Base64 encryption?

No, and this matters: it’s an encoding, reversible by anyone in one step. Never use it to hide a password or a token from someone who can see the data.

Why does my decoded text look like nonsense?

Either it isn’t Base64, or it’s Base64 of binary data (an image, a compressed file) rather than text. This page decodes as UTF-8 text.

What is a data URL for?

Embedding a small file directly in HTML, CSS or JSON instead of linking to it. Keep it to small images and icons — the encoding adds about a third to the size.

Does my data leave the page?

No. Encoding and decoding are done by your browser; nothing is sent anywhere.

More free tools

All text →