Base64 Encoder and Decoder
Encode UTF-8 text or any local file, or decode Base64 into bytes with an optional strict UTF-8 view. Choose the alphabet explicitly.
Everything is processed locally. Drafts stay in memory; refreshing clears them.5 MiB text/file input or decoded output; 8 MiB encoded decode input. Preview: first 20,000 characters; downloads are complete. Base64 is reversible encoding, not encryption. No data URLs, automatic execution or HTML interpretation.
How to encode or decode
- Choose Encode or Decode. Encoding accepts literal text or exact file bytes; decoding accepts pasted Base64 only.
- Choose standard or URL-safe alphabet. Standard output always uses padding; URL-safe padding is optional and defaults off.
- Convert explicitly after changing settings. Review byte counts and the selectable preview, then copy or download complete output. Clear offers Undo; Cancel discards the current job.
Worked example: f, fo and foo
Standard Base64 encodes f as Zg==, fo as Zm8= and foo as Zm9v. UTF-8 Swedish text and emoji round-trip correctly. Bytes FB FF encode as +/8= in standard mode and -_8 in unpadded URL-safe mode.
Strict validation rules
Standard accepts A–Z, a–z, 0–9, + and /; URL-safe substitutes - and _. The other alphabet is rejected rather than guessed. Standard requires canonical padding for partial groups; URL-safe permits correct padded or unpadded input. Internal or excess padding, length modulo four equal to one, invalid characters and nonzero unused trailing bits are rejected. Zh== is invalid; Zg== is canonical.
Whitespace is invalid unless you enable ignoring ASCII spaces, tabs, CR and LF. The removed count is shown. Unicode whitespace is still invalid; input is never trimmed or percent-decoded. Data URLs are rejected: paste only their encoded portion after the comma.
Text versus binary
Text encodes as UTF-8, with unpaired UTF-16 surrogates rejected rather than replaced. A deliberate leading U+FEFF remains in text and file mode preserves every byte. Decoded UTF-8 uses strict validation and preserves a leading BOM. Invalid UTF-8 is not invalid Base64: bytes remain available as decoded.bin with application/octet-stream, never opened or executed. Valid UTF-8 can additionally download as decoded.txt. Encoded output downloads as encoded.txt.
Limits and privacy
Maximum 5 MiB UTF-8 text or file input, 8 MiB encoded decode input and 5 MiB decoded output. Predicted decoded size is checked before allocation. A dedicated worker handles conversion; changing tabs, settings or inputs invalidates output without automatically reinterpreting it. Preview is limited to 20,000 characters; downloads always include all bytes. Copy is limited to 2 MiB of text characters; a denied clipboard leaves selectable output and download guidance.
Base64 is reversible encoding, not encryption and not a way to secure passwords or documents. No compression, remote URLs, image preview, data-URL import, content-type guessing, HTML interpretation or automatic file execution. Inputs and filenames are never placed in URLs, telemetry or browser storage by this tool.
What should we improve next?
Help shape the next update to Base64 encoder decoder. Tell us what would make it better for you.
Prefer email? feedback@tooltulip.com