Base64 Encoding / Decoding

Encode text to Base64 or decode it; convert files to Base64 / Data URI format. Special characters are fully supported.

Runs 100% in your browser — your data is never sent to a server.
Drop the file to convert to Base64, or click to select
Recommended: files smaller than 20 MB (output is ~33% larger than the file)

Convert Base64 back to a file

What Is Base64 Encoding, and When Is It Used?

Base64 is an encoding format that converts binary data — images, PDFs, audio — into text made up of only 64 safe characters (A-Z, a-z, 0-9, + and /). Every 3 bytes of binary data is converted into a 4-character chunk of text, which is why Base64 output ends up roughly 33% larger than the original data. The goal isn't to shrink the data, but to let it pass safely through a channel that only carries text (email, JSON, a URL).

Important: Base64 is NOT a form of encryption. The text it produces can be decoded instantly by anyone — even by pasting it into this very page — no extra key or password is required. Converting a password, credit card number or API key to Base64 does not HIDE it, it merely changes its representation. Actual encryption, such as AES, must be used for real confidentiality.

The most common use is Data URIs: you can embed a small icon or logo directly inside HTML/CSS as data:image/png;base64,... without a separate file request — which can speed up a page. It's also used to carry email attachments in MIME format, to send an image or certificate file to an API that only accepts text (like a JSON body), and to make parts of token formats such as JWT readable/transportable. Developers also frequently reach for this technique when embedding a binary key inside a configuration file — since most configuration formats (JSON, YAML, .env) only accept text.

The "File" tab on this tool converts any file to Base64/Data URI, and back again — you can convert a Base64 text back into the original file and download it. All text, including accented characters, is converted to UTF-8 bytes before encoding, so it works correctly; no data is ever uploaded to a server, the entire conversion happens on your device. This is an important privacy advantage when, for example, converting a certificate file or an authentication key to Base64 — your file never touches a third-party server at any stage.

Try This Next

Finished here? These might be your next step.

Frequently Asked Questions

The browser's built-in btoa() function only supports Latin-1 characters. This tool converts your text to UTF-8 bytes before encoding, so accented and non-Latin characters all work correctly.

No. Base64 is only an encoding format; anyone can decode it. Use actual encryption (e.g. AES) for secret data.

Base64 converts every 3 bytes of binary data into 4 characters of text (a 3 → 4 expansion, i.e. a 4/3 ratio). This is the mathematical cost of representing the data using only 64 safe characters — since this is encoding, not compression, the size grows rather than shrinks.

The + and / characters in standard Base64 can cause problems inside a URL (they can be interpreted as a space or a path separator, respectively). URL-safe mode replaces these two with - and _ and strips the trailing = padding — use this mode when carrying Base64 data inside a query parameter, a filename, or a JWT token.

This usually happens when a character was lost while copying the text, a character outside the Base64 alphabet got mixed in, or you're trying to decode standard Base64 data while the "URL-safe" checkbox is ticked (or vice versa). Make sure you've pasted the entire text and selected the correct mode.

Last updated: