How to use it
- Choose a direction
Encode turns text into Base64; Decode turns Base64 back into text.
- Paste text or add a file
The result updates as you type. Files become Base64 or a data URL.
- Copy or download
Copy the output, or download decoded binaries such as images and PDFs.
What Base64 is for
Base64 writes any bytes using 64 safe characters (A–Z, a–z, 0–9, + and /). It exists because many systems, such as email, JSON and HTML attributes, only carry text reliably. Every 3 bytes become 4 characters, so Base64 is about 33% larger than the original.
Why Arabic text sometimes breaks
The browser's built-in btoa() only accepts Latin-1 characters and throws an error on Arabic or emoji. Older tools work around it in different ways, which is why the same word can give different Base64 on different sites. This tool always encodes text as UTF-8 first, the same as Python, Node.js, Java and the command-line base64, so the output matches what servers expect.
Standard vs URL-safe Base64
Standard Base64 uses + and /, which have special meanings in URLs. The URL-safe variant (RFC 4648 §5) replaces them with - and _ and usually drops the = padding. JWTs use it. The decoder here accepts both, with or without padding.
Data URLs
A data URL puts a small file straight into HTML or CSS: data:image/png;base64,iVBOR…. Turn on "data URL" when encoding a file to get one. Keep it for small icons; large images are better as normal files because Base64 makes them bigger and they cannot be cached separately.
Not sure the text is Base64? Try the auto-detect decoder. Working with tokens? The JWT decoder reads the URL-safe parts for you.