Skip to content
Butter Tools Logo
Butter Tools

Base64 Encoder / Decoder

Encode text to Base64 or decode Base64 back to plain text. Supports standard and URL-safe variants.

Plain text input
Base64 output

File → Base64

Encode any file as a Base64 data URL (useful for embedding images in CSS/HTML).

No file chosen
menu_book

How to Use Base64 Encoder / Decoder

To encode text to Base64, type or paste your text into the input area and select the Encode mode. The Base64-encoded output appears instantly. To decode, switch to Decode mode, paste a Base64 string, and the original text is revealed. The tool handles both standard Base64 and URL-safe Base64 variants.

You can also encode files to Base64 by uploading them through the file input section. The tool generates a Base64 data URL that can be used directly in HTML or CSS, for example to embed images inline without a separate file request. Click Copy on either panel to copy the result.

help

Frequently Asked Questions

What is Base64 encoding used for? expand_more

Base64 is used to encode binary data — such as images, files, or binary strings — into a text-only format that can be safely transmitted in environments that only handle text, such as email bodies, JSON payloads, and HTML data URLs.

Does Base64 encoding compress data? expand_more

No. Base64 encoding actually increases data size by approximately 33% because it uses 4 characters to represent every 3 bytes of input. It is a data representation format, not a compression algorithm.

What is the difference between standard Base64 and URL-safe Base64? expand_more

Standard Base64 uses '+' and '/' characters which have special meanings in URLs. URL-safe Base64 replaces these with '-' and '_' to make the encoded string safe for use in URLs and filenames without percent-encoding.

Can I decode any Base64 string with this tool? expand_more

Yes, as long as the input is a valid Base64-encoded string. The tool decodes it back to the original text or binary content. Invalid characters in the input will cause a decode error.

Can I encode an image to Base64? expand_more

Yes. Use the file upload section to select an image file. The tool generates a complete data URL (e.g. data:image/png;base64,...) that you can embed directly in an HTML img tag.