Base64 encode and decode

Encode text to Base64 or decode Base64 back to text. Handles emoji and accented characters correctly, and accepts URL-safe Base64.

File or image to Base64

What is Base64?

Base64 turns any bytes into text using 64 safe characters (A–Z, a–z, 0–9, + and /), so binary data can travel through systems built for text, such as JSON, email and URLs. It makes data about 33% bigger. Base64 is encoding, not encryption: anyone can decode it.

Base64 vs Base64URL

Base64URL replaces + with - and / with _, and usually drops the = padding, so the result is safe in URLs and file names. JWTs use Base64URL. The decoder here accepts both.

Why does my decoded text look wrong?

If the original was not UTF-8 text (an image, a zip file, encrypted data), it cannot be shown as text. The tool detects this and shows the bytes as hex instead.

Frequently asked questions

How do I decode Base64?
Paste the Base64 string into the box with Decode selected. The text appears as you type. Line breaks and a data: prefix are ignored.
Is Base64 secure?
No. It is a reversible encoding with no key. Do not use it to hide passwords or secrets.
How do I convert an image to Base64?
Choose the image under 'File or image to Base64'. You get a data URI you can use in HTML or CSS, e.g. <img src="data:image/png;base64,…">.
Why does Base64 end with = or ==?
Padding. Base64 works in groups of 3 bytes; = marks one or two missing bytes at the end.