Base64 encoder and decoder
Encode UTF-8 text as Base64 or decode Base64 back to text.
How it works
Use standard padded Base64 by default or select URL-safe Base64 (RFC 4648). Both modes reject whitespace and require the selected alphabet. The decoder checks canonical padding and unused pad bits and rejects invalid UTF-8. A leading BOM is preserved. Base64 is reversible encoding, not encryption. Use Copy Base64 conversion summary to export the displayed output code-point count as tab-separated Metric and Value columns. <code>Aé😀</code> encodes to <code>QcOp8J+YgA==</code> (standard) or <code>QcOp8J-YgA==</code> (URL-safe), both 12 output code points including padding. Decoding gives 3 Unicode code points, not a byte or grapheme count. The summary excludes the source and converted text.
Base64 examples
- f
Zg==- foo
Zm9v- Café
Q2Fmw6k=- 😀
8J+YgA==(standard),8J-YgA==(URL-safe)- 😀?
8J+YgD8=(standard),8J-YgD8=(URL-safe)-
4L+/(standard),4L-_(URL-safe)
Accepted input and limits
Standard Base64 uses A–Z, a–z, 0–9, plus and slash, with equals signs for required final padding. URL-safe Base64 (base64url) uses hyphen and underscore instead of plus and slash. Select the alphabet explicitly for encoding or decoding. Both modes reject whitespace (including line breaks), missing required or extra padding, nonzero pad bits and characters outside the chosen alphabet. A full group of three bytes needs no padding. This tool retains required equals signs in URL-safe mode; some protocols omit them, which this tool does not support. Equals signs may still need percent-encoding when placing the result in a URL component. It accepts an empty string. Encode up to 4,000 UTF-16 units and 4,000 UTF-8 bytes; decode up to 5,336 Base64 characters representing at most 4,000 bytes. Arbitrary binary files are not supported: decoded bytes must be valid UTF-8 text. No normalization is applied.
Decoded HTML is displayed only as text; Base64 is not encryption or a sanitizer. Text fields may normalize carriage returns. Copy uses the exact decoded result, but CR and NUL require compatible secure clipboard support. Keep the original Base64 for lossless interchange.
Related: UTF-8 byte converter · Unicode inspector · Unicode normalization. Standards: RFC 4648, sections 3–5 and WHATWG Encoding Standard.
Related: URL encoder and decoder.