Base64 Converter
Encode and decode text to Base64 in your browser. Handy for binary data transfer and data URI schemes. Supports standard and URL-safe Base64 modes.
Last updated:
How to Use
Expand how to useCollapse how to use
- 1
Enter text or Base64
Paste the text you want to encode, or the Base64 string you want to decode into the input field.
- 2
Select mode and action
Choose Standard or URL-safe mode, then click 'Encode' or 'Decode' button.
- 3
Copy the result
Review the conversion result and click 'Copy' to copy to clipboard. You can also swap input/output.
Input
Output
About Base64 Converter
Base64 Encoder & Decoder converts text and files to and from Base64 entirely in your browser. It supports both standard Base64 (RFC 4648) and URL-safe mode that replaces +/ with -_ for use in URLs and query parameters. Common use cases include encoding API authentication headers (Basic Auth), inspecting JWT token payloads, embedding images as data URIs in HTML or CSS, and debugging email attachments encoded in MIME format. PEM format is also supported with automatic removal of header lines, whitespace, and line breaks. Real-time input/output size display helps you monitor encoded data size.
Key Features
- Encode text to Base64 (UTF-8 support)
- Decode Base64 to text
- URL-safe mode support (replaces +/ with -_, optional padding)
- PEM format support (automatic removal of whitespace and line breaks)
- Real-time input/output size display
Common Use Cases
- Encode/decode API authentication headers (Basic Auth)
- Create data URIs for embedding images in HTML/CSS
- Inspect Base64-encoded JWT token payloads
- Encode files for email MIME attachments
- Handle PEM-encoded certificates and keys
Frequently Asked Questions
What's the difference between standard and URL-safe mode?
Standard Base64 uses characters "+", "/", and "=", which have special meanings in URLs and can cause issues. URL-safe mode replaces "+" with "-", "/" with "_", and optionally omits the padding "=", making it safe for use in URLs and filenames.
How do I encode a Basic Auth header?
Encode the string "username:password" in standard Base64, then prefix it with "Basic ". For example, "admin:secret" becomes "Basic YWRtaW46c2VjcmV0". This is the value to put in the Authorization header.
Can I decode Base64 strings with line breaks?
Yes, Base64 strings with line breaks, such as those used in PEM certificates, are supported. Line breaks and whitespace are automatically removed before decoding.
How much does Base64 encoding increase the size?
Base64 encoding increases the size by approximately 33% compared to the original data (3 bytes become 4 characters). You can see the input/output sizes in real-time on screen.
Is my input data sent to a server?
No. Encoding and decoding use the browser's built-in atob/btoa functions locally. Credentials, PEM keys, or JWT payloads you paste here are never transmitted.
