How to use the Base64 Encode / Decode tool
- Paste text or Base64 into the input box.
- Click “Encode” or “Decode”. Tick “URL-safe” for tokens and URLs.
- To encode a file, choose it below and copy the data URL.
What is Base64?
Base64 represents binary data using 64 safe characters: A to Z, a to z, 0 to 9, plus and slash. It is used wherever data has to travel through systems that only handle text: email attachments, images embedded in HTML and CSS, JSON APIs, HTTP Basic authentication headers and JSON Web Tokens.
Base64 is an encoding, not encryption. Anyone can decode it, so never use it to hide passwords or secrets.
Standard vs URL-safe Base64
Standard Base64 uses + and / and pads the end with =. Those characters have special meaning in URLs, so URL-safe Base64 replaces + with -, / with _ and drops the padding. JWT tokens use the URL-safe variant. The decoder here accepts both forms automatically.
Files to data URLs
A data URL embeds a file directly in code, for example a small icon in CSS: background:url(data:image/png;base64,...). It saves an HTTP request for tiny files, but Base64 makes data about 33 percent larger, so it is not a good idea for big images.
Privacy
Everything you type stays in your browser. Nothing is sent to a server or stored.
Frequently asked questions
Why is Base64 output longer than the input?
Base64 uses 4 characters for every 3 bytes, so the result is about 33% larger.
Does it support emoji and non-Latin text?
Yes. Text is encoded as UTF-8 first, so any language and emoji work.
Why does decoding fail?
The input may contain invalid characters, or it may be binary data such as an image rather than text.
Can I decode a JWT?
Yes. Paste the middle part of the token (between the two dots) and click Decode to see its JSON payload.