Micro Tool Yard logo
Tools
Result
Ad Slot

How it works

  1. Choose Text or File mode

    Encode/decode plain text, or encode a whole file to Base64 and decode it back.

  2. Paste or upload your input

    Text mode works as you type; File mode reads the file locally.

  3. Copy or download the result

    Copy encoded/decoded text directly, or download a decoded file.

Base64 Encoder/Decoder converts between plain text (or files) and their Base64 representation. Text mode handles the common copy-paste case — encoding UTF-8 text to Base64 or decoding Base64 back to text, with an optional URL-safe variant for use in JWTs, query strings, or filenames. File mode handles arbitrary binary files: choose any file to see its Base64 output (optionally wrapped as a ready-to-use data: URI for embedding directly in HTML or CSS), or paste a Base64 string to decode and download it as a file.

Everything runs locally using the browser's native Base64 primitives — no file or text you enter is ever uploaded or sent to a server.

Base64 exists because a lot of systems and formats — email (MIME), JSON, URLs, older text protocols — were built to safely carry text but not arbitrary binary bytes. Encoding binary data as Base64 maps every 3 bytes of input to 4 printable ASCII characters drawn from a fixed 64-character alphabet (A–Z, a–z, 0–9, plus two more symbols), which is why encoded output is always roughly 33% larger than the original — that overhead is the cost of making arbitrary bytes safely representable as plain text. This is also why Base64 is encoding, not encryption: it's fully and trivially reversible by design, and should never be relied on to keep data confidential or secure.

The standard and URL-safe variants exist because Base64's default alphabet includes + and /, both of which already mean something specific inside a URL (a space, and a path separator, respectively). The URL-safe variant substitutes - and _ for those two characters and typically drops the = padding at the end, so the result can be dropped straight into a URL path, query parameter, or filename without needing any additional escaping — which is exactly why URL-safe Base64 is the encoding JWTs use for each of their three dot-separated segments.


FAQ

What is Base64 encoding used for?
Base64 turns arbitrary binary data into plain ASCII text, which is safe to embed in places that only handle text — email attachments, data URIs in CSS/HTML, JSON payloads, and authentication tokens like JWTs.
What does "URL-safe" mean?
Standard Base64 uses "+" and "/" characters and "=" padding, all of which have special meaning in URLs. The URL-safe variant replaces "+" with "-" and "/" with "_" and drops padding, so the result can be used directly in a URL or filename without escaping.
Can I encode and decode files, not just text?
Yes — File mode reads any file you choose, shows its Base64 output (optionally as a ready-to-use data URI), and can decode a Base64 string back into a downloadable file.
Why does decoding sometimes show an error in Text mode?
Text mode decodes to UTF-8 text. If the Base64 represents binary data that isn't valid UTF-8 (like an image), Text mode reports an error — use File mode instead, which downloads the raw bytes regardless of content type.
Is my data uploaded anywhere?
No. All encoding and decoding happens locally in your browser using native Base64 primitives — nothing is ever sent to a server.