🔄 Base64 Encoder & Decoder
Encode text to Base64 or decode Base64 strings back to readable text. Fast, free, and entirely client-side.
What is Base64 Encoding?
Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format. It's widely used in email (MIME), data URLs (embedding images in HTML/CSS), JSON Web Tokens (JWT), and API authentication headers (Basic Auth).
Common Use Cases
- Data URLs —Embed small images directly in HTML:
<img src="data:image/png;base64,iVBOR..."> - API Authentication —HTTP Basic Auth encodes "username:password" as Base64
- JSON Web Tokens (JWT) —JWT payloads are Base64-encoded
- Email Attachments —MIME uses Base64 to encode binary attachments
- URL-safe encoding —Base64URL variant for embedding data in URLs
How to Use
- Select Encode to convert text to Base64, or Decode to convert Base64 back to text.
- Paste or type your data in the input field.
- Click Convert —the result appears instantly in the output field.
- Use Swap to reverse the input/output for quick back-and-forth conversion.
- Click Copy Output to copy the result to your clipboard.
Important Notes
- Base64 is NOT encryption —it's encoding. Anyone can decode it. Don't use it to protect sensitive data.
- Size increase —Base64 increases data size by approximately 33% (every 3 bytes become 4 characters).
- Character set —Standard Base64 uses A-Z, a-z, 0-9, +, / and = for padding.
FAQ
No. All encoding/decoding uses the browser's built-in btoa() and atob() functions. Your data never leaves your device.
Base64URL is a URL-safe variant that replaces '+' with '-', '/' with '_', and omits the '=' padding. It's commonly used in JWTs and URL parameters.
Yes, but you'd need to read the file as a binary string first. For quick text encoding, paste the text directly. For file encoding, check out our Image Compressor tool which also provides Base64 data URIs.