Base64 Encoder / Decoder
Easily encode and decode text to/from Base64 format.
Base64 Is Everywhere — Here’s Your Fastest Way to Use It
Open a browser network request in DevTools, inspect an authentication header, look at an email attachment encoding, or examine a data URI in a CSS file — chances are high you’ll see Base64 somewhere. It’s one of those foundational encoding schemes that web developers encounter constantly but rarely think about until they need to quickly encode or decode something.
This tool handles it in two clicks. Paste your text, hit Encode, get your Base64 string. Paste a Base64 string, hit Decode, get your original text. Nothing leaves your browser.
What Is Base64?
Base64 is an encoding scheme that converts binary data — or text — into a string of ASCII characters from a 64-character alphabet (A–Z, a–z, 0–9, +, /, with = as padding). The result is safe to transmit through systems that might mishandle raw binary data, like email protocols, HTTP headers, or XML bodies.
It’s important to distinguish Base64 from encryption: Base64 is an encoding, not a security mechanism. Any encoded string can be decoded without a key. If you need to protect data, use proper encryption — Base64 alone provides no security.
Common Developer Use Cases
HTTP Basic Authentication
The HTTP Basic Auth scheme sends credentials as a Base64-encoded string of ‘username:password’ in the Authorization header. When debugging API authentication issues, this tool lets you quickly decode a captured header to verify the credentials being sent, or encode new credentials to test with curl or Postman.
Data URIs in HTML & CSS
Small images, SVG icons, and fonts can be embedded directly in HTML or CSS as Base64-encoded data URIs, eliminating a network request. Encode an image here and paste the result into a data:image/png;base64,… URI for inline embedding.
JSON Web Tokens (JWT)
JWTs consist of three Base64URL-encoded sections. Decoding the header and payload sections here gives you a quick way to inspect the token’s claims without a dedicated JWT debugger.
Email Attachments & MIME Encoding
MIME email encoding uses Base64 to safely encode binary attachments. If you’re debugging email systems or working with raw email files, this tool lets you decode attachment payloads or verify encoding output.
API Payloads & Webhooks
Some APIs encode request bodies or webhook payloads in Base64. Decode received payloads here to inspect the raw content quickly during integration testing.
How the Tool Works
Encoding uses the browser’s native btoa() function, which implements the standard Base64 alphabet. Decoding uses atob(). Both run entirely client-side — your text is never sent to a server. The tool also handles Unicode characters (which btoa() alone doesn’t support natively) by first converting text to a UTF-8 byte sequence before encoding.
💡 Base64 increases data size by approximately 33%. A 3-byte input produces 4 Base64 characters. Keep this in mind when embedding large files as data URIs.
Frequently Asked Questions
Q: What’s the difference between Base64 and Base64URL?
A: Standard Base64 uses + and / characters, which are special in URLs. Base64URL replaces + with – and / with _, making it safe for use in URL query parameters and JWT tokens. Our encoder outputs standard Base64; replace + with – and / with _ manually if you need Base64URL.
Q: Can I encode binary files?
A: This tool is designed for text encoding. For binary files (images, PDFs), use our Image to Base64 tool which handles binary data correctly.
Q: Is there a size limit?
A: There’s no hard limit imposed by the tool. Very large strings may slow down depending on your device’s memory, but typical developer use cases are handled instantly.
Q: Is Base64 the same as encryption?
A: No. Base64 is a reversible encoding — anyone can decode it without a key. Never use Base64 to ‘secure’ sensitive data.