Base64 Encoder / Decoder

Encode text or files to Base64, or decode it back. Runs entirely in your browser.

Plain text
Base64
 

Common questions

What is Base64?
Base64 encodes binary data as printable ASCII text. It's how email attachments travel over protocols that only handle text, and how images get embedded directly in HTML or CSS. You'll also run into it in JWTs, API credentials, and anywhere a system needs to pass binary data through a text-only channel.
Standard vs URL-safe — what's the difference?
Standard Base64 uses +, /, and = as special characters. Those characters have meaning in URLs, so they break query strings and path segments if you don't escape them. URL-safe Base64 (RFC 4648 §5) swaps + for - and / for _, and drops the = padding entirely. JWTs use URL-safe. If you're encoding something that will live in a URL, use URL-safe.
What is line wrapping for?
MIME email (RFC 2045) requires Base64 lines to be at most 76 characters. PEM certificate files use 64-character lines. If you're generating email attachments or certificate data by hand, select the matching wrap width. For everything else, leave it off.
What does "Encode each line" do?
It encodes each line of your input independently, outputting one Base64 string per line. Useful when you have a list of values — tokens, secrets, identifiers — and want each one encoded separately rather than the whole block treated as a single string.
How does file encoding work?
Your file is read in the browser using the FileReader API. No data is sent to a server. The raw bytes get chunked and encoded locally. There's no size limit imposed by the tool, though your browser has memory limits that will kick in somewhere above a few hundred MB.
What is a Data URI?
A Data URI embeds file content directly in a URL using the format data:{mime};base64,{encoded}. Browsers render them inline — paste one into an <img src>, a CSS background-image, or an <a href> and the file loads without a network request. The tradeoff: Data URIs are about 33% larger than the raw file and can't be cached separately by the browser.
How do I decode Base64 back to a binary file?
Switch to Decode, paste the Base64, and click Download. The tool converts it back to raw bytes and triggers a browser download. The file is named "decoded" — rename it with the correct extension after downloading.
Is my data safe?
Everything runs in your browser. Nothing is sent to a server. You can disconnect from the internet and the tool still works.
© 2026 Stash Tools