All tools Base64 Encoder / Decoder ● Live Developer Tools

How Base64 Encoder / Decoder works

  1. Choose Encode or Decode mode for text, or use the file section for files.
  2. Paste or type text into the input box.
  3. View the Base64-encoded (or decoded) result in the output box instantly.
  4. For files, drag and drop a file to generate its Base64 data URI.
  5. Copy the result to your clipboard or download it as a .txt file.
  • Embed a small image as a data URI directly in CSS or HTML to avoid an extra HTTP request.
  • Decode a Base64-encoded API response or JWT payload segment to read its contents.
  • Encode binary file contents for inclusion in a JSON payload.
  • Generate a data URI for a favicon or icon to inline in a stylesheet.
  • Quickly check whether a string is valid Base64 by attempting to decode it.

Encoding and decoding happen locally using the browser's built-in btoa/atob functions. Files and text are never uploaded.

  • Only standard Base64 is supported, not URL-safe Base64 variants.
  • Very large files produce very large output strings that may be slow to handle in the browser.
  • Decoding does not validate that the decoded bytes form a particular file type.

Base64 Encoder / Decoder

Base64 Encoder / Decoder converts text to and from Base64 encoding using the browser's built-in btoa/atob functions. It also handles file encoding — drop any file to get its Base64 data URI, which you can copy or download as a .txt file.

Base64 Encoder / Decoder Runs locally

Plain text input

Base64 output

Encode a file

Drop or select any file to get its base64 data URI.

Guide

How to use

  1. Choose Encode or Decode mode for text, or use the file section for files.

  2. Paste or type text into the input box.

  3. View the Base64-encoded (or decoded) result in the output box instantly.

  4. For files, drag and drop a file to generate its Base64 data URI.

  5. Copy the result to your clipboard or download it as a .txt file.

Scenarios

Use cases

  • Embed a small image as a data URI directly in CSS or HTML to avoid an extra HTTP request.

  • Decode a Base64-encoded API response or JWT payload segment to read its contents.

  • Encode binary file contents for inclusion in a JSON payload.

  • Generate a data URI for a favicon or icon to inline in a stylesheet.

  • Quickly check whether a string is valid Base64 by attempting to decode it.

Good to know

Limitations & Privacy

Private by design

Encoding and decoding happen locally using the browser's built-in btoa/atob functions. Files and text are never uploaded.

  • Only standard Base64 is supported, not URL-safe Base64 variants.

  • Very large files produce very large output strings that may be slow to handle in the browser.

  • Decoding does not validate that the decoded bytes form a particular file type.

FAQ

Frequently asked questions

Does it support binary files?

Yes. The file encoding section reads any file as a binary buffer and produces a full data URI including the MIME type prefix, suitable for use directly in HTML src attributes or CSS url().

What is Base64 used for?

Base64 is used to embed binary data (images, fonts, files) in text-based formats like HTML, CSS, JSON, and email, since those formats can't safely contain raw binary bytes. It increases data size by roughly 33%.

Why does Base64 output end with = or == sometimes?

The = characters are padding, added when the input length isn't a multiple of 3 bytes. They're a normal part of standard Base64 and required for correct decoding.

What happens if I paste invalid Base64 into decode mode?

The tool shows an error message indicating the input isn't valid Base64, rather than producing garbled output.

Does this support URL-safe Base64?

The current version uses standard Base64 (with + and / characters). URL-safe Base64 (using - and _) is not yet a separate mode.

Can I encode an entire image file?

Yes. Drop an image file into the file encoding section to get its full data URI, which can be pasted directly into an <img src> or CSS background-image.

Is there a file size limit?

There's no hard limit, but very large files produce very large Base64 strings, which can be slow to display and copy in the browser.