Free Tool
BASE64 ENCODER / DECODER
Convert text or files to Base64 and back in a click, with a URL-safe option and image preview. Everything runs in your browser — your text and files are never uploaded.
All conversion happens on your device — nothing you type is uploaded or stored. Text is handled as UTF-8, so emoji and non-English characters encode correctly.
📄
Drop a file here, or click to choose
Images, PDFs, or any file. Converted to a Base64 data URI in your browser.
Your file is read locally by your browser and converted on the spot. It is never uploaded to any server. Very large files may take a moment and produce a long string.

How to Use the Base64 Tool

  1. For text, stay on the Text tab. Paste your text and press Encode to get Base64, or paste a Base64 string and press Decode to get the original back.
  2. Tick URL-safe if the Base64 needs to go in a web address or filename — it swaps + and / for - and _ and drops the padding.
  3. For a file or image, open the File / Image tab and drop a file in (or click to choose). You'll get its Base64 data URI, ready to paste into CSS, HTML, or a JSON payload.
  4. Use Copy output to grab the result. Use Swap on the text tab to move the output back into the input for a quick round-trip.

About This Tool

Base64 is a way of writing any data — text, an image, a PDF — using only 64 safe, printable characters (A–Z, a–z, 0–9, and a couple of symbols). It exists because a lot of systems were built to carry plain text, not raw binary: email attachments, data URIs in web pages, JSON and XML payloads, tokens, and cookies all rely on Base64 to move binary data through text-only channels without it getting corrupted. Encoding makes data about a third larger, but guaranteed to survive the trip.

This tool does both directions for both text and files. On the text side it's UTF-8 aware, so accented letters, non-Latin scripts, and emoji encode and decode correctly instead of turning into garbage. The URL-safe option produces the variant used in JWTs and web links. On the file side, dropping in an image gives you a data: URI you can paste straight into a stylesheet or an <img> tag to embed the picture with no separate file — handy for small icons and email signatures.

One important note: Base64 is encoding, not encryption. It scrambles nothing and protects nothing — anyone can decode it back in a second, exactly as this tool does. It's for transport and compatibility, never for hiding secrets. If you need to keep data private, that calls for real encryption, not Base64. What this tool does guarantee is that your data stays on your device: every conversion runs in your browser with no server call, so you can safely encode files or strings that contain private information without any of it being uploaded.

Frequently Asked Questions

Is Base64 the same as encryption? Is it secure?

No. Base64 is an encoding, not encryption — it provides no security whatsoever. Anyone can decode a Base64 string instantly back to the original, with no key or password. It exists purely to move data safely through text-based systems. Never use it to hide passwords or sensitive data; for that you need genuine encryption.

Are my text and files uploaded anywhere?

No. All encoding and decoding happen in your browser using built-in JavaScript. Files you drop are read locally and never leave your device — there is no upload in this tool. That makes it safe to encode files or strings containing private information; nothing is transmitted or stored.

What is a data URI, and when would I use it?

A data URI is a string that starts with something like data:image/png;base64, followed by the Base64 of a file. It lets you embed an image or file directly inside HTML, CSS, or JSON instead of linking to a separate file — useful for small icons, email signatures, or bundling an asset into a single document. Toggle the "data: URI prefix" option to include or omit it.

What does "URL-safe" mean?

Standard Base64 uses the characters + and /, which have special meanings in web addresses and can break things. URL-safe Base64 replaces them with - and _ and usually drops the trailing = padding, so the string can be dropped straight into a URL, filename, or a JSON Web Token (JWT) without being mangled.

Why does my decoded text look wrong or fail?

Usually the input isn't valid Base64 — a stray space, a missing character, or it was URL-safe Base64 decoded as standard (or vice versa). Make sure the whole string is present and untruncated, and match the URL-safe setting to how it was encoded. This tool tolerates URL-safe input automatically, but broken or partial strings can't be recovered.