Base64 Encode / Decode
Why use this tool
Base64 shows up constantly in web development — API payloads, data URIs, JWT tokens, email attachments — and needing to quickly encode or decode a string without spinning up a script is a common small task. This runs entirely in your browser.
Result
Result appears here.
How Base64 encoding works
Base64 takes raw bytes and re-encodes them using a 64-character alphabet (A–Z, a–z, 0–9, +, /), so the result is safe to put in text-based formats like JSON or URLs that can't handle arbitrary binary data. Padding with = characters brings the output to a length that's a multiple of 4.
Common pitfalls
- Treating Base64 as encryption. It's trivially reversible by anyone — it's for encoding, not for hiding data.
- URL-unsafe characters. Standard Base64 uses
+and/, which need extra escaping in URLs. A separate "Base64 URL-safe" variant replaces these with-and_for that use case. - Copy-paste truncation. If a long Base64 string gets cut off when copied, decoding will fail — check that the length is a multiple of 4 with correct padding.
Frequently asked questions
- What is Base64 used for?
- Base64 encodes binary or text data into an ASCII-safe string, commonly used for embedding data in JSON, URLs, email attachments (MIME), and data URIs — anywhere raw binary data isn't safe to transmit directly.
- Is Base64 encryption?
- No. Base64 is an encoding scheme, not encryption — it provides no security or confidentiality. Anyone can decode Base64 instantly. Never use it to "hide" sensitive data like passwords or tokens.
- Why does decoding sometimes fail?
- Valid Base64 only uses the characters A-Z, a-z, 0-9, +, /, and = padding, with a total length that's a multiple of 4. If the input has been truncated, contains other characters, or isn't valid UTF-8 once decoded, decoding will fail — this tool shows a specific error instead of silently returning garbled text.
- Does this handle non-English text and emoji?
- Yes — encoding first converts your text to UTF-8 bytes before Base64-encoding, so accented characters, non-Latin scripts, and emoji round-trip correctly.