Skip to content
§
§ · free tool

Base64 encode & decode. Every byte stays on your device.

Encode text or files to Base64 and back — UTF-8 safe, with a URL-safe option, live encoding as you type, and ready-to-use data: URIs. Runs entirely in your browser; nothing is uploaded.

A free online tool by Digital Heroes

Encoding is UTF-8 safe, emoji and accented characters round-trip correctly.

Base64, without leaving the page

Type in the plain-text pane and the Base64 pane fills in as you type — UTF-8 handled correctly, so emoji and accented characters round-trip intact. Paste Base64 the other way and decode it back; the decoder tolerates URL-safe characters, data: URI prefixes, wrapped lines and missing padding automatically. Switch to the File tab to drop any file up to 25 MB and get its Base64 plus a ready-to-paste data: URI, or paste Base64 and download the original file it encodes. Everything happens locally on your device — no upload, no sign-up, and it keeps working offline.

§ 02 · what you can do

Every Base64 job, one page.

  • Encode any text to Base64 in real time, with full UTF-8 support for emoji, accented letters and non-Latin scripts.
  • Decode Base64 back to plain text, automatically handling URL-safe characters, data: URI prefixes and missing padding — with a hex preview instead of mojibake when the bytes are binary.
  • Convert any file to Base64 by dropping it on the File tab, with an instant preview for image files.
  • Generate a data: URI from any file, ready to paste into HTML, CSS or Markdown with no extra HTTP request.
  • Download a decoded file by pasting Base64 or a full data: URI and clicking Decode & download — the filename extension is even suggested from the MIME type.
  • Switch to URL-safe mode for JWTs, OAuth tokens and signed URLs, or wrap output at 76 characters for MIME and PEM blocks.
§ 03 · how to use it

Four steps, no manual.

  1. Type or paste into the plain-text pane — the Base64 pane encodes live as you type. Or paste Base64 on the right and click ← Decode.
  2. Toggle URL-safe for JWT/OAuth-style output, Wrap at 76 for MIME/PEM blocks, or data: URI prefix for an inline-ready string.
  3. For files, switch to the File tab and drop anything up to 25 MB — copy the Base64 or the ready-made data: URI.
  4. To go the other way, paste Base64 or a data: URI into Base64 → File, set a filename and click Decode & download.
§ 04 · faq

Frequently asked questions.

Is the data I paste sent anywhere?
No. The tool uses the browser's native btoa, atob, TextEncoder, TextDecoder and FileReader APIs, all running client-side on this page. No network request carries your content — safe for API keys, JWT secrets, encoded credentials or any sensitive value you don't want uploaded to a third party.
What's the difference between standard and URL-safe Base64?
Standard Base64 (RFC 4648 §4) uses A–Z, a–z, 0–9 plus '+' and '/'. The plus and slash break URL parameters and filenames, so URL-safe Base64 (RFC 4648 §5) substitutes '-' and '_' and usually drops the trailing '=' padding. Use URL-safe when the output goes into a URL, JSON Web Token, OAuth state parameter or filename; use standard everywhere else (data URIs, basic-auth headers, file embedding). The decoder here accepts both, with or without padding.
Why is my decoded UTF-8 garbled?
If the original was encoded as Latin-1 or another non-UTF-8 charset, decoding as UTF-8 produces mojibake. This tool decodes with TextDecoder('utf-8') in strict mode — the correct choice for modern Base64 — and shows a hex preview instead of garbled characters when the bytes are not valid UTF-8. If you know the source used a legacy charset, convert at the source.
How do I encode a binary file?
Switch to the File tab and drop the file onto the dropzone, or click it to browse (any type, up to 25 MB). The tool reads the raw bytes via FileReader and Base64-encodes them locally. You get the Base64 string and a data: URI built from the file's MIME type, each with its own copy button, plus a "Download .txt of Base64" option for large outputs.
What's the "Wrap at 76" option for?
Some legacy contexts (MIME email bodies, PEM-encoded keys, S/MIME) require Base64 wrapped at 76 characters per line, which is what tools like OpenSSL emit by default. Modern HTTP, JSON and JWT all use single-line Base64, so unwrapped is the default here. The wrap applies to text-mode output, the file-mode Base64 pane and the downloaded .txt alike — data: URIs always stay single-line.
Why does Base64 of a 100-byte string take 136 characters?
Base64 encodes every 3 input bytes as 4 output characters — a fixed ~33% size overhead, plus '=' padding to a multiple of four. So 100 bytes become 136 characters (132 data + 4 padding). That's the cost of representing binary data using only printable-ASCII-safe characters. For larger payloads, compress the binary first, then Base64 it.

Published · Last updated .

Online now

Hey there 👋 How can we help you today?