Free Base64 Encode & Decode Tool

Free Base64 encoder and decoder: encode text to Base64 or decode Base64 strings back to plain text online. Full UTF-8 support, instant results, fully private.

  • No upload, 100% private
  • Instant, in your browser
  • 100% free, no signup
Loading tool…
Read the complete guideWhat Is Base64 Encoding and How Does It Work? A Practical Guide →

About the Base64 Encode / Decode tool

Base64 turns any text or binary data into a safe set of 64 printable characters. You meet it everywhere in web development: HTTP Basic authentication headers, data URLs for small images, email attachments, JSON Web Tokens and API fields that must carry binary content. This converter lets you encode plain text to Base64 or decode a Base64 string back into readable text in one click.

Text is converted to UTF-8 bytes before encoding, so Hindi, Tamil, emoji and other non-English characters encode and decode correctly instead of throwing an error. When decoding, the tool ignores spaces and line breaks, accepts the URL-safe alphabet (with - and _) and adds any missing = padding for you. There is also a “File to Base64” button that reads any file from your device and shows its raw Base64 content, which you can then copy into code or a config.

All work is done in your browser with built-in JavaScript functions. Nothing you paste or upload leaves your device, so it is safe to decode credentials or inspect tokens.

How to use Base64 Encode / Decode

  1. Choose “Encode” to turn text into Base64, or “Decode” to turn Base64 back into text.
  2. Type or paste your text into the Input box.
  3. Click the “Encode” or “Decode” button under the input to see the result on the right.
  4. Use the swap arrows to move the output back into the input and flip the mode.
  5. To encode a file instead, click “File to Base64” and choose the file.
  6. Click “Copy Result” to copy the output.

Features

UTF-8 safe

Text in any language, including emoji, is encoded as UTF-8 so it round-trips correctly.

Forgiving decoder

Whitespace is ignored, URL-safe Base64 is accepted and missing padding is added automatically.

File to Base64

Read an image, PDF or any other file and get its Base64 string without a data-URL prefix.

Swap in one click

Move the result back to the input and reverse the direction to double-check a conversion.

Local processing

Encoding and decoding use the browser’s own functions and never touch a server.

When to use it

  • Build an HTTP Basic Authorization header from a username and password.
  • Decode a Base64 field from an API response or a Kubernetes secret to read its value.
  • Embed a small icon or font into CSS or HTML as Base64 data.
  • Inspect the readable parts of a JWT or an encoded email header.
  • Prepare binary content for a JSON field that only accepts text.

Frequently asked questions

Is Base64 a form of encryption?

No. Base64 is only an encoding and anyone can decode it instantly. Never rely on it to hide passwords or secrets.

Why do I get “Invalid input” when decoding?

The string contains characters that are not part of Base64, or it decodes to binary data that is not valid UTF-8 text, such as an image. Only text results can be shown in the output box.

Does it support URL-safe Base64?

Yes, for decoding. The - and _ characters are converted to + and / automatically. Encoded output uses the standard alphabet with = padding.

Why is the Base64 output longer than my text?

Base64 represents every 3 bytes with 4 characters, so the output is roughly 33% larger than the original data.

Is there a size limit for files?

There is no fixed limit, but the whole file is read into memory and shown on the page, so very large files can make the browser slow. It works best for files of a few megabytes or less.

Can I decode a Base64 image back into a picture?

This tool shows decoded results as text only. To view an image, put the Base64 string after data:image/png;base64, in your browser’s address bar or an <img> tag.

Related tools