Skip to content
Pro
TREN

Base64 Encode and Decode

Convert text or a file to Base64 and back. The work runs in your browser, so the data goes nowhere.

How it works

  1. Choose the Text tab or the File tab.
  2. Set the direction: Encode or Decode.
  3. Copy the result, take a data URL or download the file.

Why this tool

  • Two directions for text and for files: encode and decode.
  • Correct UTF-8 handling, so accented letters survive.
  • An option for the URL safe form (-_ and no padding).
  • For files, both raw Base64 and a data URL.
  • A 50 MB file limit. The file stays on your computer.

People often think Base64 is encryption. It is not. Base64 is an encoding. It turns binary data into a safe 64-letter alphabet. There is no key and no password. Anyone can decode it in one step. To hide a password with Base64 is the same as leaving it in plain text.

So what is it for? Some channels carry text only: an email body, a JSON field, an XML node, an HTTP header, an image inside HTML. To move a binary file through those channels, you must first turn it into text. Base64 does exactly that.

The cost is size. Three bytes become four characters, so the data grows by about a third. A 100 KB PNG becomes 134 KB as a data URL. That is fine for small icons. Serve large images as separate files instead.

There are two forms. The standard form uses plus and slash. The URL safe form writes a hyphen and an underscore and drops the padding at the end. JWT and many APIs need the URL safe form.

Old tools break text with accented letters, because they do not use UTF-8 when they turn characters into bytes. This tool uses TextEncoder, so ş, ğ, İ and emoji survive the round trip.

The encoding runs in your browser. Your file and your text stay on your computer.

Frequently asked questions

Is Base64 encryption?

No. Base64 is only an encoding. There is no key and anyone can decode it. Do not use it to hide secret data.

What is Base64 for?

It moves binary data through channels that carry text. Email attachments, images in data URLs, files inside JSON and HTTP headers all work this way.

Why does the size grow?

Base64 turns every 3 bytes into 4 characters, so the result grows by about a third. Line breaks add a little more.

What is the URL safe form?

The plus and slash characters cause trouble in a URL. The URL safe form writes a hyphen and an underscore and drops the padding. JWT uses this form.

Why do accented letters break elsewhere?

Old tools do not use UTF-8 when they turn characters into bytes. This tool uses TextEncoder, so ş, ğ and İ survive the round trip.

Does my file go to a server?

No. The file is read and encoded in your browser. The limit is 50 MB. Above that the browser can run out of memory.