Base64 Encoder & Decoder

Encode and decode Base64 text and files in your browser. Image preview included. No data leaves your device.

Runs entirely in your browser. Nothing is sent to our servers.

Or upload a file (encode mode only):
Replaces +/ with -_ and drops = padding.

About this tool

Base64 is a way to represent binary data as ASCII text. It's used in data URLs, email attachments, JWTs, basic-auth headers, and lots of API payloads. This tool handles both standard Base64 and the URL-safe variant, encoding either text strings or files in your browser.

Standard vs URL-safe

Standard Base64 uses A–Z, a–z, 0–9, +, and /, with = padding to make the output length a multiple of 4. URL-safe Base64 substitutes - for + and _ for /, and typically omits padding. JWTs use URL-safe Base64; HTTP headers usually use standard.

Encoding files

Upload a file in encode mode and the tool returns a data URL ready for pasting into a stylesheet, an HTML src attribute, or anywhere else a data URL is accepted. Image files render in the preview so you can confirm the encoding round-trips correctly.

Frequently asked questions

Is Base64 encryption?
No. Base64 is encoding, not encryption. Anyone with the encoded string can decode it. Use it for representation, never for protecting secrets.
Why does my decoded output look like gibberish?
Either the input was binary data (an image, a PDF) being decoded as text, or your input wasn't actually Base64. The status line will say if the input failed to decode.
How large a file can I encode?
Limited by your browser's memory. Files up to about 100 MB usually work fine; beyond that, the browser tab may become unresponsive while encoding.
Does this tool send my file anywhere?
No. File reading and encoding both happen in your browser using the FileReader API. The file never leaves your device.

Last updated: May 17, 2026