Skip to content
ToolBox World

Base64 Encoder / Decoder

Base64 turns binary data into plain ASCII text so it can travel safely through JSON, email and URLs. Encode any text or file, or decode a Base64 string back to readable text or the original file.

Runs in your browser100% freeNo sign-up
Loading tool…

How to use the Base64 Encoder / Decoder

  1. 1

    Choose “Encode” or “Decode”.

  2. 2

    Type text into the input box, or pick a file to encode it.

  3. 3

    Enable “URL-safe” if the output will be used in a URL or JWT.

  4. 4

    Copy the result, or download the decoded file.

Features & benefits

  • UTF-8 safe

    Correctly encodes emoji and non-Latin characters, unlike basic btoa().

  • File support

    Encode images or documents up to 10 MB, or create data URIs for CSS and HTML.

  • URL-safe variant

    Uses - and _ instead of + and / and removes padding, as used by JWTs.

  • Decode to file

    Turn a Base64 string back into a downloadable binary file.

What is Base64?

Base64 represents binary data using 64 printable characters: A–Z, a–z, 0–9, plus “+” and “/”. Every three bytes of input become four characters of output, so encoded data is about 33% larger than the original.

It is commonly used to embed images in HTML or CSS as data URIs, attach files in email (MIME), and carry binary values inside JSON. Base64 is an encoding, not encryption — anyone can decode it, so never use it to protect secrets.

Frequently asked questions

Is Base64 secure?

No. Base64 is a reversible encoding with no key. It hides nothing; use real encryption for sensitive data.

Why does decoding show garbled characters?

The original data was probably binary (like an image) rather than text. Use “Download as file” to save it in its original form.

What is URL-safe Base64?

A variant that replaces “+” with “-” and “/” with “_” and drops “=” padding so the string can be used in URLs and file names.