Base64 Encoder / Decoder
Encode text or files to Base64, or decode Base64 back. UTF-8 safe with optional URL-safe alphabet.
Quick answer: Encode text or files to Base64, or decode Base64 back. UTF-8 safe with optional URL-safe alphabet.
Last updated
Frequently asked questions
- What is Base64 encoding?
- Base64 represents binary data using 64 ASCII characters (A–Z, a–z, 0–9, + and /). It's used to embed binary content (images, files, keys) inside text-only formats like JSON, XML or HTTP headers.
- Is Base64 encryption?
- No. Base64 is a reversible encoding, not encryption — anyone can decode it instantly. Never use Base64 to hide secrets; use real encryption (AES, RSA, or HTTPS) instead.
- How do I decode a Base64 string?
- Paste the Base64 string, pick Decode, and the original text or file appears. UTF-8 characters (accents, emoji, non-Latin scripts) are decoded correctly.
- Why do APIs use Base64?
- To safely include binary data (images, PDFs, signatures) inside JSON or XML payloads where binary bytes would otherwise corrupt the format. It also avoids escaping issues in HTTP headers.
- Can Base64 contain special characters?
- Standard Base64 uses A–Z, a–z, 0–9, +, / and = (for padding). The URL-safe variant uses - and _ instead of + and /, so the result can travel inside a URL without encoding.
- How do I encode JSON to Base64?
- Stringify your JSON (JSON.stringify), paste the resulting text into the encoder, and copy the Base64 output. The result is safe to embed in URLs, headers, or other JSON.
- Why does Base64 output end with =?
- Equals signs are padding to make the output length a multiple of 4. They're added automatically when the input length isn't a multiple of 3 bytes.
- Can I Base64 encode files or images?
- Yes. Drop a file and the encoder produces a base64 data: URL (or just the Base64 body). Useful for embedding small icons in CSS or HTML.
- How do I decode Base64 in JavaScript?
- atob(str) decodes ASCII Base64; for UTF-8 use TextDecoder over Uint8Array.from(atob(str), c => c.charCodeAt(0)). This tool handles UTF-8 automatically.
- Is Base64 safe to share?
- Base64 is just an encoding — anyone can decode it. Treat the decoded content as the real secret: don't share Base64-encoded passwords, tokens or private keys.