Base64 encoder and decoder

Encode and decode Base64 text, and turn files into data URLs.

Text

Encode a file

Turn an image, font or any small file into Base64 or a data URL to embed in HTML, CSS or JSON. The file stays on your device.

How to use it

  1. Choose Encode to turn text into Base64, or Decode to turn Base64 back into text. The result updates as you type.
  2. Tick URL-safe for Base64 that goes in links or tokens. When decoding, URL-safe Base64, missing padding and line breaks are all handled for you.
  3. To embed an image or font, use Encode a file and copy the data URL. If Base64 decodes to a file rather than text, you can preview or download it.

Questions

What is Base64 used for?

It turns any data into plain letters and numbers so it can travel through systems built for text: email attachments, data URLs in HTML and CSS, JSON APIs, and the middle part of login tokens (JWTs).

Is Base64 encryption?

No. Anyone can decode it, as this page shows. It changes how data is written, not who can read it, so never use it to hide passwords or personal data.

Why does my decoded text look garbled?

The original was probably a file, such as an image or a PDF, rather than text. This tool spots that and offers the file to download instead of showing unreadable characters.

What’s the difference between Base64 and URL-safe Base64?

Standard Base64 uses + and /, which have special meanings in web addresses. URL-safe Base64 swaps them for - and _ and usually drops the = padding at the end.