BrowserLeaksUSBrowserLeaksUS

Base64 Encode / Decode

Encode or decode Base64 strings - fully client-side

Base64 Converter

What this tool does

Encodes text to Base64 or decodes Base64 back to text - fully in your browser. Supports URL-safe Base64 variant for tokens and query strings.

Who it's for: Developers embedding binary data in JSON or URLs, engineers working with JWTs, and anyone pasting mystery Base64 strings from logs.

When to use

  • •Encode a small image or binary as a data URI.
  • •Decode a base64-encoded email body or HTTP header value.
  • •Embed credentials into a Basic Auth header.
  • •Inspect the contents of a Data URI.

How it works

  1. 1Paste text in the input area.
  2. 2Toggle encode/decode.
  3. 3Result updates live as you type.
  4. 4All computation is local - no data leaves your browser.

Tips

  • •Base64 is encoding, NOT encryption - never use it to hide secrets.
  • •Base64 adds ~33% size overhead - avoid for large payloads.
  • •Use URL-safe variant (- and _) inside query strings and JWTs.

Using this result

How to read a Base64 encode and decode

01

What the output box is

Base64 is a way to write binary bytes as ASCII so they can sit inside JSON, XML, or a URL without being corrupted. The output on this page is that transcription, not encryption. Anyone can reverse it. Use the encode direction when you have text or a file and you need the transport form. Use the decode direction when you pasted a string that already looks like Base64 and you want the original bytes back as text.

Standard Base64 uses plus and slash, and it pads the end with equals signs so the length is a multiple of four. URL-safe Base64 swaps plus and slash for minus and underscore and often drops the padding. If a decode fails, the first thing to check is which alphabet you used. A JWT or a data URI is almost always standard or URL-safe, not a third variant. Pasting only the middle of a string, or leaving a line break that was not in the original, produces garbage or an error rather than a partial secret.

02

Text, files, and data URIs

Text is encoded as UTF-8 bytes first, then those bytes are encoded as Base64. That is why a character outside ASCII becomes several characters in the output. Decoding uses the same path in reverse. If the decoded text shows replacement characters, the original was not UTF-8 text. It was a file, a compressed blob, or a different charset. Switch to the file view for those. The file control reads the bytes in the browser and never uploads them. The result is still only an encoding. It will be about a third larger than the file.

A data URI is a Base64 payload with a prefix such as data:image/png;base64,. Keep the prefix when you are embedding an image in CSS or HTML. Strip it when you only want the payload. Do not put passwords or private keys through this box and then paste the result into a ticket. The result is readable by anyone with a decoder, including this one. For a one-way fingerprint of the same bytes, use the Hash Generator instead.