Base64 Encoder / Decoder
Convert text to Base64 and back. Supports Unicode and URL-safe mode. Everything runs in your browser — nothing leaves your device.
About Base64
Base64 is a binary-to-text encoding scheme that represents binary data as ASCII characters using a 64-character alphabet (A–Z, a–z, 0–9, +, /). Three input bytes are packed into four output characters, making the encoded string roughly 33% larger than the original.
The URL-safe variant replaces + with - and / with _, and omits padding (=) so the result is safe to use directly in URLs and filenames without percent-encoding.
Common Use Cases
- Data URIs — embed images or fonts directly in HTML/CSS. Try the Image to Base64 converter or go the other way with Base64 to Image.
- Email (MIME) — encode binary attachments for text-based transport
- JSON APIs — send binary data in JSON payloads. Format responses with the JSON Formatter.
- HTTP Auth — Basic Authentication encodes credentials as Base64
- JWT tokens — header and payload are Base64url-encoded. Decode them with the JWT Debugger.
- URL parameters — encode data for query strings with the URL Encoder.
- Read more: Base64 Encoding: A Complete Developer Guide
Tips
- Base64 is encoding, not encryption — anyone can decode it. Use the Hash Generator for one-way hashing.
- Use URL-safe mode for tokens, query params, or file names
- Encoded output is always ~33% larger than the input
- This tool supports full Unicode (emoji, CJK, accents)
- No data is sent to any server — conversion is 100% local
- Compare encoded strings side-by-side with the String Diff tool
How to Use the Base64 Encoder / Decoder
Paste your text
Type or paste any text into the Input panel on the left. Unicode, emoji, and multi-line text are all supported.
Choose Encode or Decode
Select Encode to convert plain text to Base64, or Decode to convert Base64 back to plain text.
Toggle URL-safe mode
Enable URL-safe mode if your output will be used in a URL, filename, or JWT token. It replaces +// with -/_.
Copy the result
Click Copy Output in the sidebar to copy the encoded or decoded string to your clipboard instantly.
Frequently Asked Questions
Is Base64 the same as encryption?
No. Base64 is reversible encoding with no secret key — it makes binary data printable, not private. Use proper encryption (AES, RSA) when you need security.
Why does Base64 output end with = or ==?
Padding characters ensure the output length is always a multiple of 4. One = means the input had 2 remaining bytes; == means 1 remaining byte.
What is URL-safe Base64?
Standard Base64 uses + and / which have special meaning in URLs. URL-safe mode replaces them with - and _, and usually omits padding.
Can I encode images with this tool?
This tool encodes text. To encode binary files like images, use the Image to Base64 tool instead.