← Home

Base64 Encoder / Decoder

Encode text to Base64 or decode it back, using the 64 printable ASCII characters that let binary or non-ASCII data travel safely through plain-text channels like email, JSON fields and data: URIs. Text is treated as UTF-8, so emoji and non-Latin scripts round-trip correctly — note that Base64 is not encryption and adds about 33% to the size.

Text ⇄ Base64
File → Base64
📄
Drop a file here or click to select
The file never leaves your device — it's encoded locally in your browser.

What is Base64?

Base64 encodes arbitrary bytes using only 64 printable ASCII characters, so binary data (or non-ASCII text) can travel safely through channels that expect plain text — email attachments, JSON fields, data: URIs embedded in CSS/HTML, and so on. It isn't encryption and adds about 33% to the size; it's purely a text-safe representation. Text here is encoded as UTF-8, so emoji and non-Latin scripts round-trip correctly.

How to Encode / Decode Base64

  1. Enter text — type the string to encode into the "Text ⇄ Base64" box, or paste the Base64 you want to decode.
  2. Pick a direction — click the "Encode →" or "← Decode" button.
  3. Convert a file — to turn a file into Base64, drag it onto the "File → Base64" area or click to select it.
  4. Copy — use the result's "Copy" button to put it on your clipboard. For files you can choose whether to include the data: URI prefix with the checkbox.

What is a data: URI?

A data: URI embeds a file's contents directly inside a document with no separate link, written as data:[MIME type];base64, followed by the Base64 data. For example, data:image/png;base64,iVBOR… can be pasted straight into a CSS background or an <img src> to show a small image without a separate request. Untick the checkbox if you only need the raw Base64 without the prefix.

Is Base64 encryption?

No. Base64 is only an encoding, not encryption. Anyone can turn it straight back into the original data with no key at all, so it provides no security. Just because it looks unreadable to a person, you must never store or transmit passwords or sensitive information wrapped only in Base64.

Why does the size increase?

Base64 represents every 3 bytes (24 bits) as 4 characters, so the data grows by about 33%. This is unavoidable overhead because each character carries only 6 bits, and adding line breaks or a data: prefix can make it slightly larger still.

Is my data uploaded?

No. Encoding and decoding run entirely in your browser using the built-in btoa/atob and FileReader APIs — nothing is sent to a server. For files, the output is a data: URI you can paste directly into a stylesheet or image tag; untick the checkbox if you only want the raw Base64. If decoding fails, the input isn't valid Base64 (or isn't valid UTF-8 text) and you'll see a clear message.