DevToolBox

Base64 Encoder & Decoder

Free online tool to encode text to Base64 and decode Base64 to text. Convert files to Base64, preview Base64 images, and use URL-safe encoding. Works entirely in your browser - your data stays private.

Text Encoder / Decoder

Characters: 0

Characters: 0

File to Base64

Base64 to Image Preview

Characters: 0

What is Base64 Encoding?

Base64 is a binary-to-text encoding scheme that converts binary data into an ASCII string format. It uses 64 printable characters (A-Z, a-z, 0-9, +, and /) to represent binary data, making it safe to transmit through text-based protocols like email or HTTP.

Common use cases for Base64 encoding include:

  • Embedding images directly in HTML or CSS (data URIs)
  • Encoding email attachments (MIME)
  • Storing binary data in JSON or XML
  • Transmitting data through URL parameters
  • Basic authentication headers in HTTP

Frequently Asked Questions

How do I encode text to Base64?

Simply paste your text into the input field, select "Encode" mode, and click the Encode button. The Base64-encoded result will appear instantly. You can then copy it to your clipboard or download it as a text file.

How do I decode Base64 to text?

Switch to "Decode" mode, paste your Base64 string into the input field, and click Decode. The original text will be revealed. This works with both standard and URL-safe Base64 formats.

What is URL-safe Base64?

URL-safe Base64 replaces the characters + and / with - and _ respectively, and removes trailing = padding. This makes the encoded string safe to use in URLs without additional encoding. Toggle the "URL-safe Base64" option to use this format.

Can I convert files to Base64?

Yes! Use the "File to Base64" section to upload any file. The tool will convert it to a Base64 string. You can optionally include the data URI prefix (like data:image/png;base64,) which is useful for embedding images directly in HTML or CSS.

Is my data secure when using this tool?

Absolutely. All encoding and decoding happens entirely in your browser using JavaScript. Your data never leaves your device and is not sent to any server. You can even use this tool offline once the page is loaded.

How do I preview a Base64 image?

Paste your Base64 image string (with or without the data URI prefix) into the "Base64 to Image Preview" section and click "Preview / Validate". If it's a valid image, it will be displayed immediately. You can also download the decoded image file.

Why does Base64 increase file size?

Base64 encoding represents 3 bytes of binary data using 4 characters, resulting in approximately 33% larger file sizes. This overhead is the trade-off for being able to safely transmit binary data through text-based systems.

🔒

100% Private

All processing happens in your browser. Your data never leaves your device.

Instant Results

No server roundtrips. Get your encoded or decoded results immediately.

🌐

Works Offline

Once loaded, the tool works without an internet connection.