Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 strings back to plain text. Supports UTF-8 and binary data.
About the Base64 Encoder / Decoder
Base64 encoding converts binary data or text into a radix-64 ASCII string format, commonly used for embedding images directly in HTML/CSS, transmitting data in APIs, or storing binary content in text-only databases. Our tool handles both encoding and decoding with full UTF-8 support, ensuring accurate conversion for international characters and emoji. All processing runs locally in your browser — nothing is sent to any server.
What Is Base64 Encoder / Decoder?
Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters: A–Z, a–z, 0–9, plus '+' and '/' (or '-' and '_' in the URL-safe variant), with '=' used for padding. Every three bytes of input are split into four 6-bit groups, each mapped to one of the 64 characters. The result is a string that can travel safely through systems designed for text — email, JSON, URLs, XML — without corruption from control characters or encoding mismatches. It is important to understand that Base64 is an encoding, not encryption: it provides no confidentiality and can be reversed by anyone. It is typically used when you need to embed or transport binary data inside a text-only medium, not to protect secrets.
How to Use
- Enter or paste the text you want to encode/decode in the input field above.
- Click 'Encode' to convert your text to Base64 format.
- Click 'Decode' to convert a Base64 string back to plain text.
- Copy the result using the Copy button.
- Use the output in your HTML, CSS, API requests, or data URIs.
Common Use Cases
- Embedding small images or icons directly in HTML, CSS, or Markdown as data URIs
- Encoding credentials, tokens, or binary payloads inside JSON or XML API requests
- Storing binary blobs in text-only storage such as environment variables or .env files
- Decoding Base64 values found in JWT header/payload sections during debugging
- Transferring files or binary attachments through email (MIME) and legacy systems
Examples
Hello, 世界 🌍
SGVsbG8sIOS4lueVjCAl8J+Mjg==
UTF-8 text (including emoji) encoded to Base64.
Tips & Best Practices
- Base64 encoding increases data size by approximately 33%.
- For image embedding, the Image to Base64 tool on this site offers a dedicated UI.
- Base64 is commonly used in JSON Web Tokens (JWT) and data URL schemes.
- UTF-8 support means Chinese characters, emojis, and special symbols encode correctly.
Frequently Asked Questions
Is Base64 the same as encryption?
No. Base64 is a reversible encoding, not encryption. Anyone can decode a Base64 string, so never use it to protect sensitive data. For confidentiality you need a real encryption algorithm such as AES — see the Hash Generator tool for related cryptographic primitives.
Why does my decoded text show garbled characters?
This usually means the original text was encoded in a charset other than UTF-8, or the Base64 string was truncated. Our tool decodes as UTF-8, which covers virtually all modern text including emoji and CJK characters.
What is the URL-safe Base64 variant?
The standard alphabet uses '+' and '/', which have special meaning in URLs. The URL-safe variant replaces them with '-' and '_' and often omits padding. JWTs use the URL-safe variant for all three segments.
How much larger is Base64 than the original?
Roughly 33%. Three input bytes become four Base64 characters, plus possible padding. For binary data like images this overhead is usually acceptable; for large files prefer a direct binary transfer.
This base64 encoder / decoder runs entirely in your browser. No data is uploaded to any server. Your privacy is completely protected.
Related Tools
Image to Base64
Convert images to Base64 data URIs. Embed images directly in HTML, CSS, or JSON without external files.
URL Encoder / Decoder
Encode special characters for URLs or decode percent-encoded URLs back to readable text.
JWT Decoder
Decode JWT tokens and inspect the header, payload, and signature. No data is sent to any server.
Hash Generator
Generate MD5, SHA-1, SHA-256, SHA-384, and SHA-512 hashes from any text input.