Base64 Encoder & Decoder

Encode text or images to Base64. Decode Base64 back. All in your browser.

100% in your browser. Nothing uploaded.

Input
Output
Ready.

Base64 encoding and decoding in your browser

This free tool lets you encode any text string to Base64 and decode Base64 back to readable text — entirely in your browser tab. It also converts any image file into a Base64 data URL with a live local preview, so you can embed images directly in HTML or CSS without hosting them separately. Because everything runs client-side, nothing you paste or drop is ever sent to a server.

How to encode text

  1. Make sure the Text tab and Encode → Base64 direction are selected.
  2. Paste your text into the left pane (or click Sample for a quick demo).
  3. Click Run, or press Ctrl+Enter.
  4. Copy or download the Base64 output on the right.

How to decode Base64

  1. Switch the direction to Decode ← Base64.
  2. Paste the Base64 string into the left pane.
  3. Click Run — the decoded text appears on the right.

How to convert an image to Base64

  1. Click the Image tab.
  2. Drop an image onto the drop zone, or click it to open a file picker.
  3. A live preview appears above and the full data URL is ready to copy below it.

How to encode any file to Base64

  1. Click the File tab.
  2. Drop any file (PDF, ZIP, audio, video, binary…) onto the drop zone, or click to choose.
  3. Pick Data URL for a ready-to-embed data:<mime>;base64,… string, or Raw Base64 for the bare encoded bytes.
  4. Copy or download the result.

Batch / multi-line mode

Check Batch (one value per line) to process multiple values at once. Each line in the input pane is encoded or decoded independently, and the output pane returns one result per line. Empty lines pass through unchanged.

Why use this one

FAQ

Is it safe to encode sensitive data here?

Yes. The encoding happens entirely in your browser tab using built-in JavaScript APIs. Nothing you type or paste is transmitted to a server. That said, Base64 is encoding, not encryption — anyone with the Base64 string can decode it instantly. Do not confuse the two.

Why does my decoded output look like garbled characters?

This usually means the Base64 string was not originally encoded as UTF-8 text — it could be binary data (an image, a PDF, a compiled file). Try the Image tab if you are working with a Base64 data URL. If it is generic binary, you will need a hex viewer rather than a text decoder.

What is a Base64 data URL and how do I use it?

A data URL bundles a file's MIME type and Base64 content into a single string starting with data:image/png;base64,…. You can paste it directly into an HTML <img src="…">, a CSS background-image: url(…), or anywhere that accepts a URL. This lets you embed small images in your markup without an external file.

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

Standard Base64 uses + and / as the 62nd and 63rd characters, which need percent-encoding in URLs. URL-safe Base64 replaces them with - and _ so the string can be embedded in a URL or file name without modification. The decoder here accepts both variants.

How large a file can I convert to Base64?

The limit is your browser's available memory. For images, anything under a few megabytes converts instantly. Very large images (above ~10 MB) may cause the browser to pause briefly while reading the file, but the work still happens locally and the result is the same.

Why is Base64 output about 33% larger than the input?

Base64 maps every 3 bytes of input to 4 ASCII characters, and padding (=) rounds up to the nearest multiple of 4. So a 100-byte input becomes roughly 136 characters. This size overhead is the cost of making arbitrary binary data safe to transport over text-only channels like HTTP headers, JSON, and email.