How to encode and decode Base64

Base64 shows up everywhere — in JSON payloads, data URLs, email attachments, and config files — and it confuses people because it looks like a secret code but isn't one. This guide explains what it actually is, when you need it, and how to encode or decode it in your browser with the free Base64 Encoder / Decoder.

What Base64 is (and isn't)

Base64 represents data using 64 text-safe characters so it can travel through anything that expects plain text. Crucially, it is not encryption — it hides nothing and anyone can reverse it instantly. If a token or value is "just Base64," treat it as readable plain text.

Encoding and decoding text

Paste text into the Base64 tool to encode it, or paste Base64 to decode it back. If the result ends in one or two = signs, that's normal — it's padding that fills out the final group of characters, and a decoder expects it.

Hello, world!  →  SGVsbG8sIHdvcmxkIQ==

Encoding an image as a data URL

You can also Base64-encode an image to embed it directly in HTML or CSS, so it loads with no extra request. Image to Base64 produces a ready-to-paste data URL. It's great for tiny icons; avoid it for large photos, because Base64 inflates the size by roughly a third.

Base64 vs. URL encoding

They solve different problems. Base64 makes binary data text-safe; URL encoding escapes characters that have special meaning in a web address (spaces, &, ?). If what you're really doing is putting a value into a link, reach for the URL Encoder instead.

A note on privacy

Base64 strings often wrap tokens or config. The Base64 tool runs in your browser, so nothing you paste is ever uploaded to a server.

Open the Base64 tool →

Common questions

What is Base64?

Base64 is a way of representing binary data — or any text — using only 64 safe characters (A–Z, a–z, 0–9, + and /). It lets you carry data through channels that only reliably handle text, such as JSON fields, email, or a URL. It is an encoding, not encryption: anyone can decode it.

Is Base64 a form of encryption?

No. Base64 hides nothing — it is trivially reversible and provides zero security. If you see a token stored as Base64, treat it as plain text. Use it for transport and embedding, never to protect a secret.

Why would I Base64-encode an image?

To embed the image directly in HTML or CSS as a data URL, so it loads without a separate file request. It is handy for tiny icons and email templates, though it makes the text much larger, so it is a poor fit for big images.

Why does Base64 text end in one or two equals signs?

The = characters are padding. Base64 works in groups of three bytes; when the input doesn't divide evenly, one or two = signs pad the final group. They are part of valid Base64 and a decoder expects them.

Is my data uploaded when I encode or decode it?

No. Encoding and decoding run entirely in your browser, so tokens, config values, and images never leave your device.