Base64 Encoder / Decoder
Encode text or files to Base64, or decode Base64 back to its original form. All processing happens in your browser—your data stays private.
Input
Base64 Output
Encoded output will appear here
Quick Examples
What is Base64?
Base64 Base64 is a binary-to-text encoding scheme that represents binary data using 64 ASCII characters. It's commonly used to encode binary data (like images or files) for transmission through text-based protocols like email or embedding in HTML/CSS.
Common Use Cases
- Data URLs: Embedding images directly in HTML/CSS without separate file requests
- Email attachments: MIME encoding for sending binary files through email
- API authentication: Basic auth headers use Base64-encoded credentials
- JSON payloads: Encoding binary data to include in JSON APIs
URL-Safe Base64
Standard Base64 uses + and / characters which have special meaning in URLs. URL-safe Base64 replaces these with - and _to make the output safe for use in URLs and filenames.
How Base64 Encoding Works
- Enter text or select a file to encode
- Choose URL-safe encoding if needed (for use in URLs)
- Click 'Encode' to convert to Base64
- To decode, paste a Base64 string and click 'Decode'
- All processing happens in your browser - no data is sent to servers
Common Examples
Encoding Text
Text: 'Hello, World!' → Base64: 'SGVsbG8sIFdvcmxkIQ=='
Data URLs for Images
Encode images to embed directly in HTML/CSS without separate file requests. Format: data:image/png;base64,...
API Authentication
Encode username:password for Basic Auth headers. Example: 'user:pass' → 'dXNlcjpwYXNz'
Common Mistakes to Avoid
- Not using URL-safe encoding when Base64 is used in URLs (use - and _ instead of + and /)
- Trying to decode binary data as text (use file download instead)
- Forgetting that Base64 increases data size by ~33%
- Not handling padding correctly (Base64 strings should be multiples of 4 characters)
Frequently Asked Questions
What is Base64 encoding?
Base64 is a binary-to-text encoding scheme that converts binary data into ASCII characters. It's commonly used for embedding binary data in text-based formats like JSON, XML, or HTML.
Is Base64 encryption?
No, Base64 is encoding, not encryption. It's easily reversible and provides no security. Anyone can decode Base64-encoded data.
When should I use URL-safe Base64?
Use URL-safe Base64 when the encoded string will be used in URLs, filenames, or other contexts where + and / characters might cause issues.
Does Base64 increase file size?
Yes, Base64 encoding increases data size by approximately 33% because it uses 4 characters to represent 3 bytes of binary data.
Can I encode files?
Yes, you can encode any file type. The tool supports text, images, PDFs, and other binary files. All processing happens in your browser.
Category:
Developer Tools →Related Tools
JSON Formatter & Validator
Format, validate, minify, and explore JSON data. Interactive tree view with syntax highlighting and ...
Cron Expression Generator
Build and understand cron expressions visually. Schedule tasks with human-readable explanations and ...
Hash Generator
Generate MD5, SHA-1, SHA-256, SHA-384, and SHA-512 hashes for text or files. Verify hash integrity a...