Local Tools Online

Base64 Encode / Decode

Convert text, files, or images to and from Base64 directly in your browser. No uploads, no server round-trip — the encoding math happens on your device using standard browser APIs.

What Base64 is actually for

Base64 isn’t encryption — it’s a way of representing binary data (images, files, arbitrary bytes) using only printable ASCII characters, so it can be safely embedded inside text-based formats like JSON, HTML, CSS, XML, or email. You’ll run into it constantly if you work with:

  • Embedding small images directly into CSS or HTML via data: URIs, avoiding an extra HTTP request
  • Decoding the payload of a JWT (which is Base64-encoded, though the signature portion isn’t reversible)
  • Reading email attachment headers (MIME encodes binary attachments as Base64)
  • Passing binary-ish data through APIs or config files that only accept text fields
  • Debugging authentication headers, since Basic Auth credentials are Base64-encoded (not encrypted) in the Authorization header

Why local encoding matters here specifically

Because Base64 is reversible with zero effort, anything you paste into an online Base64 tool that isn’t local-only is effectively being handed over in plain text to whatever server processes it. If you’re decoding an API token, a credential string, or a chunk of a file that contains anything sensitive, a server-side tool defeats the purpose of even thinking about privacy. This tool decodes and encodes using the btoa/atob and FileReader APIs built into your browser — the same mechanisms browsers use natively, just exposed with a simple interface.

How to use it

  1. Switch between “Encode” and “Decode” mode using the toggle at the top.
  2. For text: paste directly into the input box and see the converted output update in real time.
  3. For files: drag and drop an image, PDF, or any file onto the drop zone. It’ll be converted to a Base64 string (optionally as a ready-to-use data: URI you can paste straight into CSS or HTML).
  4. Use the “URL-safe” toggle if you need the URL-safe Base64 variant (which replaces + and / with - and _, common in JWTs and URL query parameters).
  5. Copy the output with one click, or download decoded binary output as a file if you’re reversing a file-to-Base64 conversion.

Common situations this solves

  • Decoding a JWT payload to inspect claims without needing a full JWT debugging library installed.
  • Embedding a small icon or logo directly in a CSS file as a data:image/png;base64,... string to cut an HTTP request.
  • Reversing a Base64 string found in an API response or log file to see what it actually contains.
  • Decoding Basic Auth headers while debugging network requests in dev tools.
  • Converting a small file into a text-safe format for pasting into a system that doesn’t support binary uploads (some config management tools, some chat platforms).

Frequently asked questions

Is Base64 encoding the same as encryption? No — this is a common misconception. Base64 provides zero confidentiality; anyone can decode it instantly, including by hand with a lookup table. It exists purely to make binary data safe to embed in text formats. If you need actual security, look for hashing (one-way) or proper encryption (reversible only with a key), not Base64.

Why does my decoded output look like garbage/broken characters? This usually means the input wasn’t valid Base64 to begin with, or it represents binary data (like an image) rather than text, so viewing it as plain text will show unreadable characters — try the “decode as file” option instead to download it properly.

What’s the difference between standard and URL-safe Base64? Standard Base64 uses +, /, and = characters, which have special meaning in URLs and need escaping. URL-safe Base64 swaps those for -, _, and omits padding, so the result can be dropped directly into a URL query string or path without escaping.

Can this handle large files, like a multi-MB PDF? Yes, though very large files (100MB+) may take a few seconds to process since Base64 encoding increases the data size by roughly 33% and your browser needs to hold both versions in memory during conversion.

Does encoding to Base64 compress the file? No — it actually makes it larger (roughly 4 bytes of Base64 output for every 3 bytes of input). Base64 is about compatibility with text formats, not compression.