Free Base64 Encoder/Decoder

Encode any text to Base64 format or decode Base64 strings back to readable text. Free, fast, and works entirely in your browser with no sign-up required.

Updated

Share:
Home/Utility Tools/Base64 Encoder / Decoder

Base64 Encoder / Decoder

Encode text, files, and images to Base64 or decode Base64 back. Supports URL-safe encoding, MIME line wrapping, data URIs, batch processing, and more.

Input

Drop any file here or click to browse

Supports images, PDFs, binaries, and more

Base64 Output

Output will appear here

Standard Base64

Uses A–Z, a–z, 0–9, +, /. Padded with =. Default for MIME, email, and most APIs.

URL-Safe Base64

Replaces +- and /_, no = padding. Safe in URLs, filenames, and JWT tokens.

Data URIs

Format: data:[mime];base64,[data]. Embeds files directly in HTML/CSS without extra HTTP requests.

Frequently Asked Questions

What is the Base64 Encoder/Decoder?

The Base64 Encoder/Decoder is a free online tool that encodes text to Base64 format and decodes Base64 strings back to readable text.

Is the Base64 Encoder/Decoder free?

Yes, it is completely free with no registration required. All encoding and decoding happens client-side in your browser.

What is Base64 used for?

Base64 encoding is used to safely transmit binary data as text in emails, URLs, APIs, and data URIs for embedding images in HTML/CSS.

Is my data safe with this tool?

Absolutely. The Base64 Encoder/Decoder processes everything client-side in your browser. No data is uploaded to or stored on any server. Your content remains private on your device at all times.

Does the Base64 Encoder/Decoder work on mobile devices?

Yes, the Base64 Encoder/Decoder is fully responsive and works on smartphones and tablets. You can use it on any device with a modern web browser -- no app download required.

Do I need to create an account to use this tool?

No account or registration is needed. Simply open the Base64 Encoder/Decoder in your browser and start using it immediately. There are no sign-up walls or usage restrictions.

How do I use the Base64 Encoder/Decoder?

Simply enter your input in the provided field, adjust any settings to your preference, and the tool will process it instantly. You can then copy the result to your clipboard or download it.

Which browsers are supported?

The Base64 Encoder/Decoder works in all modern browsers including Chrome, Firefox, Safari, Edge, and Opera. For the best experience, use the latest version of your preferred browser.

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

Standard Base64 uses the 64-character alphabet A-Z, a-z, 0-9, plus the symbols + and /, with = for padding. The trouble is that +, /, and = all have special meaning in URLs and aren't valid in filenames, so a standard Base64 string can break when placed in a query parameter or path. URL-safe Base64 fixes this by swapping + for - and / for _, and usually dropping the trailing = padding. The decoded data is identical; only the alphabet changes. This URL-safe variant is what JWT tokens and many web APIs use. This tool offers both: pick the URL-safe option to encode, and on decode it auto-reverses the substitution and restores padding so the string decodes cleanly. Toggle URL-safe above before encoding.

Why is my Base64 output larger than the original text?

Base64 represents data using only 64 printable characters, so it has to spread the bits across more characters than the raw bytes would need. Specifically, every 3 bytes of input are regrouped into four 6-bit chunks and mapped to four Base64 characters. That 3-to-4 ratio means the encoded output is roughly 33% larger than the source, plus a few extra characters for = padding when the input length isn't a multiple of three. The size increase is expected and unavoidable, which is why Base64 suits small payloads like inline images or credentials rather than large files. This tool reports the input size, output size, and overhead percentage for each conversion, so you can see the exact growth. Paste your text or drop a file above to encode it and check the size stats.

Is Base64 encoding a form of encryption or secure?

No. Base64 is an encoding, not encryption, and it adds no security whatsoever. It simply rewrites bytes using a public 64-character alphabet so binary data can travel safely through text-only systems like email and JSON. Anyone can reverse a Base64 string back to its original content instantly with no key, password, or secret involved, exactly the way this decoder does. A string that looks scrambled is therefore not protected; encoding a password in Base64 is the same as storing it in plain text. If you need to keep data confidential, use real encryption such as AES and then, if required, Base64-encode the encrypted bytes for safe transport. Use this tool to encode or decode for compatibility and data transport, but never rely on it to hide sensitive information.

Why does Base64 output sometimes get split into multiple lines?

Some systems can't handle one continuous, very long line of Base64. The classic example is email: the MIME standard wraps encoded attachments into fixed-width lines, typically 76 characters, so older mail servers and clients don't choke on them. That's why a Base64 blob copied from an email source or PEM certificate often appears as many short lines rather than a single string. The line breaks are not part of the data; decoders ignore the whitespace and reconstruct the original bytes regardless. This tool lets you control wrapping directly: enable line wrapping to break output at the MIME default of 76 characters, or set any column width from 1 to 200 to match a target format. When decoding, pasted line breaks are handled automatically. Adjust the wrap option above before you copy your encoded result.

How do I embed an image as a Base64 data URI in HTML or CSS?

A data URI lets you place an image directly inside HTML or CSS instead of linking to a separate file, which removes one HTTP request for small graphics like icons. The format is data:[mime-type];base64,[encoded-data] -- for example data:image/png;base64, followed by the encoded bytes. To build one, drop your image file into the encoder, which reads the file, encodes it, and can emit the full data URI for you including the correct MIME type. You then paste that string into an img tag's src attribute or a CSS background-image url(). Keep in mind that Base64 adds about 33% to the file size, so data URIs are best for small assets; large images are better left as normal file references. On decode, this tool auto-detects a pasted data URI and renders the image back. Drop an image above to generate its data URI.

Embed This Tool

Add a free, live version of this widget to your own website or blog post — it runs entirely in your visitors' browsers, with a credit link back to The Toolbox.

Copy & paste this HTML
<iframe src="https://getthetoolbox.com/embed/base64-encoder" title="Free Base64 Encoder/Decoder — The Toolbox" width="100%" height="280" style="max-width:480px;border:1px solid #e2e8f0;border-radius:12px" loading="lazy"></iframe>
<p style="font-size:12px;margin:4px 0 0"><a href="https://getthetoolbox.com/utility-tools/base64-encoder?utm_source=embed&utm_medium=widget" target="_blank" rel="noopener">Free Base64 Encoder/Decoder</a> by The Toolbox</p>

About the Base64 Encoder/Decoder

The Base64 Encoder/Decoder converts text, files, and images into Base64 and turns Base64 strings back into their original form. Base64 is a way of representing binary data using only 64 printable ASCII characters — the letters A–Z and a–z, the digits 0–9, and the symbols + and /, with = used for padding. That makes it possible to carry arbitrary bytes through systems that were built to handle plain text, such as email bodies, JSON payloads, and URLs.

The tool runs entirely in your browser. Encoding and decoding happen on your own device using the browser's built-in functions, so nothing you paste or upload is sent to a server. There is no sign-up and no file-size account limit — you can encode a confidential config file or a private API key and it never leaves your machine.

What you can encode and decode

The encoder works in three input modes, selectable as tabs:

  • Single — type or paste text, or drop a file (images, PDFs, binaries, and more) into the upload zone. Images show a live preview, and decoding a Base64 image string renders the picture back on screen.
  • Batch — paste one value per line to encode or decode them all at once, then export the results as a CSV file.
  • Compare — view the original and converted text side by side with character counts and size stats.

A Swap button feeds the output straight back in as the next input, so you can round-trip a value to confirm it decodes cleanly. A local history panel keeps your recent conversions (stored only in your browser) so you can reload an earlier input with one click.

Standard, URL-safe, and other output options

Plain Base64 isn't safe everywhere. The +, /, and = characters have special meaning in URLs and aren't allowed in filenames, which is why the tool offers a URL-safe variant that replaces + with -, / with _, and drops the padding. This is the encoding used in JWT tokens and many web APIs. On decode, the tool reverses the substitution and restores padding automatically.

For encoding you can also:

  • Wrap output into fixed-width lines — the MIME standard wraps at 76 characters, the default here, and you can set any column width from 1 to 200.
  • Strip padding to remove the trailing = signs when a target system doesn't need them.
  • Emit a data URI for uploaded files in the form data:[mime-type];base64,[data], ready to paste into HTML or CSS.

When decoding, an auto-detect option recognises a pasted data:...;base64,... string and extracts the payload for you.

Why Base64 matters and where it's used

Many protocols are text-only by design. Base64 lets binary data ride along inside them without corruption. Common uses include embedding small images as data URIs to avoid an extra HTTP request, attaching files in email via MIME, encoding credentials in HTTP Basic Auth headers, and packing binary blobs into JSON or XML.

One trade-off is worth knowing: Base64 is an encoding, not encryption. It is fully reversible by anyone and adds no security on its own. It also makes data larger — every 3 bytes become 4 characters, so encoded output is roughly 33% bigger than the source. The tool surfaces this directly, reporting the input and output sizes and the overhead percentage for each conversion. A built-in explainer can even walk through your text byte by byte, showing how the bits are regrouped into 6-bit chunks and mapped to Base64 characters.

Paste some text or drop a file above to encode it, switch to Decode to reverse any Base64 string, and copy or download the result when you're done.