About the Base64 Encode/Decode
Base64 turns binary data into plain ASCII text so it can travel safely through email, JSON, URLs and HTML. Use this tool to encode text or files to Base64, decode Base64 back to readable text, and create URL-safe Base64 strings – with full UTF-8 support for emoji and non-English characters.
Like every tool on this site, it runs entirely in your web browser using JavaScript. Your files and text are never uploaded to a server, which makes it fast, free and private.
How to use the Base64 Encode/Decode
- Type or paste text into the input box.
- Click “Encode” to convert to Base64, or “Decode” to convert Base64 back to text.
- To encode a file (e.g. an image), drop it into the file box to get a data URL.
- Copy the output.
What is Base64 used for?
Embedding small images in CSS or HTML as data URLs, sending attachments in email (MIME), encoding credentials in HTTP Basic Authentication headers, storing binary data in JSON, and in JSON Web Tokens (which use URL-safe Base64).
Base64 is not encryption
Anyone can decode Base64 – it provides no security. Never use it to hide passwords or secrets. Encoded data is also about 33% larger than the original.
Frequently asked questions
What is URL-safe Base64?
It replaces + with - and / with _ and removes padding, so the result can be used in URLs and filenames.
Why does decoding fail?
The input may contain invalid characters or not be UTF-8 text (for example, it may be an encoded image).
Is my data private?
Yes, encoding runs locally.
Does it support emoji?
Yes, text is encoded as UTF-8.
Guides and how-tos
- How to Format, Validate and Fix JSON – Beautify, minify and validate JSON online for free. Learn how to read error messages and fix trailing commas, quotes and other common JSON syntax mistakes.