Tool
Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 back to plain text. Instant, browser-side — no data leaves your device.
Encoding and decoding happens entirely in your browser — nothing is sent to any server.
About
What is Base64?
Base64 is a binary-to-text encoding scheme defined in RFC 4648 that represents arbitrary binary data using 64 printable ASCII characters: A–Z, a–z, 0–9, +, and /. Every 3 bytes of input becomes 4 Base64 characters, with = padding added to make the output length a multiple of 4.
Base64 was created to safely transmit binary data — like images or attachments — through systems that only handle text. Email (MIME), HTTP, JSON, and many protocol layers were designed around ASCII and would corrupt raw binary data. Base64 sidesteps this by encoding everything as printable characters.
This tool runs entirely in your browser. No input is transmitted to any server — encoding and decoding happens locally using JavaScript's built-in btoa() and atob() functions.
Where It's Used
Common Base64 Use Cases
- JWT Tokens — The header and payload sections of JSON Web Tokens are Base64URL-encoded (a URL-safe variant). Decoding the payload reveals all claims — user ID, expiry, roles — without needing a key.
- HTTP Basic Authentication — Basic Auth encodes credentials as Base64('username:password') in the Authorization header. This is encoding, not encryption — the credentials are trivially recoverable from the header.
- Email Attachments — MIME email attachments are Base64-encoded to survive transmission through mail servers that only handle 7-bit ASCII. This is why attachment headers include 'Content-Transfer-Encoding: base64'.
- Data URIs — Images can be embedded directly in HTML and CSS as data:image/png;base64,... URIs. Useful for small icons and inline images that shouldn't require separate HTTP requests.
- API Payloads — APIs that accept binary data (images, documents, audio) in JSON bodies encode the binary as Base64 since JSON cannot represent raw bytes directly.
FAQ
Frequently Asked Questions
What is Base64 encoding?+
A binary-to-text encoding scheme using 64 printable ASCII characters (A-Z, a-z, 0-9, +, /). Every 3 bytes of input becomes 4 Base64 characters. Used to safely transmit binary data through text-only channels.
Is Base64 encryption?+
No. Base64 is encoding, not encryption. It provides zero confidentiality — anyone can decode it instantly. Never use Base64 to hide sensitive data. It only converts binary to text-safe format for transport.
Where is Base64 used?+
JWT tokens, HTTP Basic Auth credentials, email attachments (MIME), data URIs for images in HTML/CSS, and binary API payloads in JSON. It's ubiquitous in web development.
What is Base64URL?+
A URL-safe variant that replaces + with - and / with _, and omits padding (=). Safe for use in URLs and filenames without percent-encoding. JWTs use Base64URL for header and payload.