Home / Code & Encoding Tools / Base64 Encode/Decode
Base64 Encode/Decode
Encode or decode text and files to Base64 instantly in your browser.
What is Base64 encoding?
Base64 is a way to represent binary data (text, images, files) as an ASCII string using only letters, digits and a few symbols. It was originally designed for sending data safely over media that only handle text, such as old email. Today it is everywhere: data URLs, JSON APIs, authentication headers, and embedding small images directly into HTML or CSS.
Why would you encode or decode Base64?
Encoding exists when a transport channel only accepts text. Common real-world cases:
- Embedding an image as a `data:` URL so the browser does not need an extra request.
- Passing binary-safe content through JSON, which cannot hold raw bytes directly.
- Textbook-safe handling of tokens, keys, or payloads that contain non-printable characters.
Decoding is what you do when you receive such a string and need the original file or plain text back.
How to use this tool
Everything runs on your device. Paste a string and choose Encode or Decode, or drop a text file in — the result is generated instantly. To convert a real binary file (an image, for example) you can paste the data URL form and decode it back to view or download the original. No data is ever uploaded.
Base64 vs Binary: which should you use?
Use Base64 when text transport forces it (URLs, JSON, data URIs). Keep regular binary or direct file transfer when you control the channel, since Base64 inflates size by about 33%. For web assets, a smaller fallback like WebP plus real file hosting usually beats baking Base64 into HTML.
Frequently asked questions
- Is Base64 encryption? No. It is encoding for transport, not security — anyone can decode it instantly.
- Does Base64 make data smaller? No, it makes text/binary about 33% larger.
- Will my data be uploaded? No. Encoding and decoding happen entirely in your browser.
- Is it free? Yes, this tool is free and requires no sign-up.