Converters
Base64 Encoder & Decoder
Encode text or files to Base64, or decode it back — with full Unicode support and a safe, text-only preview. Free, instant, entirely local to your browser.
Runs entirely in your browser. Nothing is uploaded.
Output appears here. ⓘ This decodes to something that looks like HTML or script — shown above as plain text only. Nothing on this page executes it.
or drop a file here — up to 10 MB, entirely local to your browser
Detected type: —
ⓘ This decodes to something that looks like HTML or script. It is never executed here — only offered below as a plain downloadable file.
What this tool does
Converts text or files to Base64, or decodes Base64 back to its original form — entirely in your browser. Base64 turns arbitrary bytes into plain ASCII text, which is why it shows up everywhere binary data needs to travel through something that only really handles text: data URIs embedded in CSS or HTML, attachments inside JSON, authentication tokens, and email.
How to use it
- Switch between Text and File at the top, depending on what you're converting.
- In Text mode, type or paste your content and press Encode or Decode. Swap moves the output into the input so you can continue in the other direction.
- In File mode, choose a direction — encoding a file to Base64, or decoding Base64 back to a downloadable file.
- Turn on URL-safe if the result needs to go directly into a URL or query parameter.
Why decoding here is safe, even for untrusted input
Base64 can encode literally anything — including a working <script> tag.
A tool that decodes it and drops the result straight into the page as HTML would execute
that script right there, which is a well-known trap for exactly this category of tool. This
page never does that: decoded text is always inserted as plain, literal text — never parsed
or executed as markup, regardless of what it contains. When something you decode looks like
it might be HTML or a script, the tool tells you so directly, and still only ever shows you
the text.
The same principle applies to file decoding. Common image formats are previewed using a plain image tag, which only ever decodes pixel data and cannot execute anything — but SVG is deliberately left out of that automatic preview, since it's the one image format capable of containing live script. Anything decoded to a file is offered strictly as a download, never opened or run.
A note on file size
Base64 encoding inflates data by roughly a third, so a 10 MB file becomes a little over 13 MB of text. Browsers can hold much more than that in memory, but very large files make for an unwieldy wall of text to work with — the size limit here exists to keep the tool responsive, not because of any technical ceiling on Base64 itself.
Questions
Is this Base64 tool free?
Yes, completely, with no signup and no limit on how much you encode or decode.
Is my data uploaded anywhere?
No. Every conversion — text or file — happens entirely in your browser. Nothing is sent to a server; you can confirm this yourself by watching your browser's Network tab while using the tool.
Could decoding something malicious here actually run it?
No, and this is deliberate. Base64 can encode absolutely anything, including HTML or JavaScript, and a tool that carelessly displays decoded output can accidentally execute whatever it decodes — a well-known trap for exactly this category of tool. This page never does that: decoded text is always shown as inert, literal text, never interpreted as HTML or run as code. If what you decode looks like it contains markup or a script tag, the tool tells you so — and still just shows you the text.
What about decoding to an image — is that safe?
Yes, with one deliberate exception. Common raster formats (PNG, JPEG, GIF, WEBP, BMP) are previewed using a plain image tag, which only ever decodes pixel data — it cannot execute anything, no matter what the file contains. SVG is the one image format that can contain live, executable script, so it's deliberately excluded from the automatic preview here rather than relying on it being handled safely.
Does it handle emoji, accented letters, and non-English text correctly?
Yes. Encoding and decoding both go through proper UTF-8 conversion rather than the naive approach some tools use, which quietly corrupts anything outside basic Latin characters. A round trip through this tool always gets you back exactly what you started with.
What does "URL-safe" Base64 mean, and when would I need it?
Standard Base64 uses +, /, and = padding — all of which have special meaning inside a URL. URL-safe Base64 swaps those for - and _ and drops the padding, so the result can go directly into a URL or query parameter without extra encoding. You'll see this format in things like JWTs.
Why would I Base64-encode a file at all?
Most often to embed it directly in text-based formats that can't hold raw binary — inlining a small image directly in CSS or HTML as a data URI, embedding a file in JSON, or pasting binary content somewhere that only accepts plain text.
Related tools
Code & data
JSON Formatter
Beautify, minify and validate JSON with precise error locations.
Code & data
HTML Formatter
Indent messy HTML or minify it for production.
Converters
Color Converter
HEX, RGB, HSL, HSV — type any format, see them all.
Converters
Timestamp Converter
Unix timestamp ↔ date, in UTC and local time, live.