Quick answer

How to use the free Base64 Encoder

To encode or decode Base64 for free, type or paste your text (or drop a file), and click Encode or Decode. All conversion happens locally — your data is never uploaded.

Mode
0 chars
0 chars

What is Base64 and when should you use it?

Base64 is a standard encoding that converts binary data into a safe ASCII string format. Developers use it daily to embed images in HTML and CSS via data URIs, transmit binary payloads in JSON APIs, encode authentication credentials in HTTP headers, and store binary blobs in text-only databases or configuration files. This tool lets you encode plain text or files to Base64 and decode Base64 strings back to readable text — all instantly in your browser with zero uploads.

How to use this tool

Select Encode mode to convert text or a file into Base64. Paste your text and click Encode, or use the file picker to encode any file. Switch to Decode mode to paste a Base64 string and convert it back to readable text. The Swap button moves the output into the input field and flips the mode, making round-trip testing effortless. Copy the result with one click.

UTF-8 and special characters

Unlike a naive btoa call that fails on non-ASCII characters, this tool uses TextEncoder and TextDecoder under the hood so you can safely encode emoji, accented characters, CJK text, and any valid UTF-8 string without errors.

Questions

Frequently asked questions

What is Base64 encoding?

Base64 is a binary-to-text encoding scheme that converts binary data into a string of ASCII characters. It uses 64 printable characters (A–Z, a–z, 0–9, +, /) plus = for padding, making it safe to transmit binary data in text-based formats like JSON, XML, email, and URLs.

Why does Base64 increase the size of data?

Base64 encodes every 3 bytes of input into 4 ASCII characters, resulting in roughly 33% larger output. This trade-off is intentional — it guarantees the data can pass through text-only channels without corruption.

Can I encode files like images or PDFs to Base64?

Yes. Use the file upload option to select any file. The tool reads it locally in your browser and outputs the Base64 representation. This is useful for embedding small images in CSS or HTML data URIs.

Is my data sent to a server?

No. All encoding and decoding happens entirely in your browser using built-in JavaScript APIs (btoa, atob, TextEncoder, TextDecoder). Nothing is uploaded or stored anywhere.

What happens if I try to decode an invalid Base64 string?

The tool will display a clear error message letting you know the input is not valid Base64. Common issues include incorrect padding, illegal characters, or corrupted data. Fix the input and try again.

Free Base64 encoder & decoder

Encode text or files to Base64, or decode Base64 strings back to their original form — instantly in your browser. Useful for embedding images in HTML/CSS, encoding API credentials, and decoding data from emails and config files. Nothing is uploaded, everything is local.

How to encode or decode Base64

  • Type or paste your text into the input.
  • Click Encode to convert to Base64, or Decode to convert back.
  • For files, upload them and the Base64 string appears instantly.
  • Copy the result or download it.

What is Base64 encoding?

Base64 converts binary data (like images or bytes) into a plain ASCII string of 64 safe characters. It's used everywhere: embedding images in HTML and CSS via data URIs, transmitting binary data in JSON, encoding email attachments (MIME), and storing complex data in text-only formats like XML and YAML.

When to use Base64

  • Embedding small images directly in HTML/CSS (data:image/png;base64,...).
  • Encoding API credentials for HTTP Basic Authentication.
  • Decoding Base64 email attachments.
  • Inspecting the content of JWT tokens (the middle section is Base64).

Frequently asked questions

Is Base64 encryption? No — Base64 is encoding, not encryption. Anyone can decode it, which is exactly why the ToolCrix decoder can read it instantly.

Does Base64 encoding increase file size? Yes — Base64 adds about 33% overhead, which the ToolCrix encoder makes visible when you encode files to data URIs.

Can I Base64-encode files, not just text? Yes — drop any file into the ToolCrix Base64 encoder and the string is generated instantly, ready for data URIs or JSON payloads.

Is it safe to decode strings containing credentials? Yes — the ToolCrix Base64 encoder/decoder runs entirely in your browser, so API keys, Basic Auth headers and tokens are never uploaded.

GuideBase64 Encode & Decode: A Developer's GuideRead the full guide →