Base64 Decoder & Encoder
Decode Base64 strings back to text, or encode any text to Base64. Supports UTF-8, URL-safe Base64, and line-wrapped output. All processing happens in your browser.
Base64 Decoder โ Convert Base64 to Text
Base64 decoding converts a Base64-encoded string back into its original form. Paste a Base64 string (it will look like a long sequence of letters, numbers, and +/= characters) and the decoded text appears instantly. The decoder handles both standard Base64 (RFC 4648) and URL-safe Base64 (which replaces + with - and / with _).
Base64 Encoder โ Convert Text to Base64
Switch to the Encode tab to convert any text, JSON, XML, HTML, or string into Base64. This is useful for embedding binary data in text formats, creating data URIs for images, encoding API credentials (HTTP Basic Auth uses Base64), and preparing data for JWT tokens. The encoder uses the browser's built-in btoa() function with full UTF-8 support.
What Is Base64?
Base64 is a binary-to-text encoding scheme that represents data using 64 printable ASCII characters โ the letters A-Z and a-z, digits 0-9, and the characters + and /. The = character is used for padding. Base64 encodes 3 bytes of binary data into 4 characters, making encoded strings about 33% larger than the original. Base64 is not encryption โ it is trivially reversible without any key.
URL-Safe Base64
Standard Base64 uses + and / which have special meaning in URLs. URL-safe Base64 (Base64url, RFC 4648 ยง5) replaces these with - and _, making the encoded string safe to use directly in URLs and filenames. JWT tokens use URL-safe Base64 without padding. Toggle the "URL-safe" option above to switch between formats.
Common Uses of Base64
JWT tokens: the header and payload of a JWT are Base64url encoded. Data URIs: images embedded in HTML/CSS use data:image/png;base64,โฆ. HTTP Basic Auth: credentials are sent as Authorization: Basic base64(user:password). Email attachments: MIME encoding uses Base64 for binary attachments. API payloads: binary data is often Base64-encoded to safely transmit in JSON.