Base64 Encoder & Decoder
Encode text and files to Base64, decode Base64 back to text, and build data URIs — all in your browser
Everything runs in your browser — nothing you paste or upload is sent anywhere.
Advanced options
Up to 10 MB. The file is read locally and never uploaded.
Base64 output
Never Leaves Your Browser
Encoding and decoding happen locally — no upload, no server
Files and Data URIs
Drop in a file up to 10 MB and get its Base64 and data URI
URL-Safe Alphabet
RFC 4648 URL-safe output and RFC 2045 line wrapping on demand
Frequently asked questions
What is Base64 actually for?
It rewrites arbitrary binary data using only 64 printable characters, so it can travel through channels that only accept text: email attachments (MIME), JSON payloads, JWT parts, data URIs in CSS and HTML, and HTTP headers. It is an encoding, not encryption — anyone can decode it, so never use it to hide a secret. The cost is size: Base64 output is about 33% larger than the input.
When should I use the URL-safe alphabet?
Standard Base64 uses "+" and "/", which have their own meaning inside URLs and file names — "+" can become a space and "/" becomes a path separator. RFC 4648 §5 swaps them for "-" and "_" and usually drops the "=" padding, which is what JWTs and most APIs that put Base64 in a query string or path use. The decoder here accepts both alphabets, so you never have to say which one you pasted.
Why does my decoded output look like garbage?
Because the data was never text. Base64 can carry any bytes — a PNG, a ZIP, a protobuf message — and rendering those bytes as characters gives you noise. If the bytes are not valid UTF-8 this tool says so and offers a download instead, so you can save the real file rather than copy a broken string.
Does my text or file leave my browser?
No. Encoding uses the browser's built-in btoa/atob and TextEncoder APIs, and a file you choose is read with the File API on your own machine. There is no upload, no API call and nothing stored — you can disconnect from the network and the page keeps working.