Base64 Encoder & Decoder
Free Base64 encoder and decoder — byte-accurate, so it round-trips any file or binary losslessly (unlike tools that crash on non-text). UTF-8 text, URL-safe variant for JWTs, MIME line-wrapping, data-URI builder, file upload, and a hex view for binary.
Base64 Encoder/Decoder — Convert Text and Files to Base64
Base64 is a text encoding that lets you embed binary data (images, files) into text-only contexts — emails, JSON APIs, HTML data URIs, JWT tokens, and configuration files. Our Base64 Encoder converts plain text or files into Base64, and decodes Base64 strings back to their original form. Useful for developers, integrators, and anyone working with web APIs.
Unlike most online converters — which are built on the browser's btoa/atob and throw an error the moment you decode the Base64 of a real file (a PNG, PDF or ZIP is rarely valid UTF-8) — this tool works at the byte level. Any byte sequence round-trips exactly: encode a file, decode it back, and you get the identical bytes. When decoded data isn't text, you get a hex view and a one-click download instead of a crash.
Paste text, paste a Base64 string, or upload a file. Get instant encoding or decoding. No signup, no cost.
How to Use Base64 Tools
1. Choose Mode
Encode (text/file → Base64) or Decode (Base64 → text/file).
2. Paste or Upload
Paste your text or Base64 string, or upload a file (image, PDF, any binary).
3. Auto-Convert
Conversion happens instantly. Output appears below ready to copy or download.
4. Copy or Download
Copy the output to clipboard or download as a file. Perfect for pasting into code or curl commands.
Base64 Tool Features
Lossless for Any File
Byte-accurate encoding and decoding. Any binary — PDF, image, ZIP, random bytes — round-trips exactly, with no corruption and no "URI malformed" error.
URL-Safe Variant
Toggle URL-safe Base64 (uses - and _ instead of + and /, no padding) for JWTs and URL parameters. The decoder accepts both alphabets automatically.
Data URI Builder
For images, generate a complete data: URI ready to paste into HTML or CSS — with a live image preview when you decode one back.
Full Unicode (UTF-8)
Correctly handles emojis, Hindi, Chinese, Arabic and every other script — no broken characters, no deprecated escape() tricks.
Tolerant Decoding
Paste Base64 with line breaks, spaces, missing padding or a full data: URI prefix — it still decodes. Invalid input gets a clear message naming the bad character and position.
MIME Line-Wrapping
Optionally wrap output at 64 or 76 characters per line for email (MIME), PEM keys and certificates.
Live Conversion
Encoding and decoding happen as you type, with running size and overhead stats — no "convert" button to click.
Free and Private
All processing happens in your browser. Files and text never leave your device — no signup, no tracking.
Base64 Encoder/Decoder — FAQs
decodeURIComponent(escape(atob(...)))). A PNG, PDF or ZIP isn't valid UTF-8, so that step throws "URI malformed" and you get nothing back. This tool decodes to raw bytes first, so any file round-trips exactly. If the result isn't text, you'll see it in hex and can download it as a file.= padding (common in JWTs), accepts both the standard and URL-safe alphabets, and even lets you paste a full data:...;base64, URI. If a character genuinely isn't valid Base64, you get a clear error naming it and its position.