Base64 Encoder & Decoder (Text + Images)
Encode and decode Base64 text locally, with context for data URIs, images, JWTs, and padding.
- No length limits
- No registration
- Free forever
- Your text never leaves your browser
What Is Base64 Used For?
Base64 converts arbitrary bytes into a safe subset of ASCII — the letters A–Z and a–z, the digits 0–9, plus “+” and “/”, with “=” reserved for padding. Because the output is nothing but plain printable characters, it can travel through systems that were built for text and would otherwise corrupt or reject binary data. The classic destinations are email attachments (SMTP is a text-only protocol), data URIs in HTML and CSS, JSON and XML payloads, configuration files, and the three segments of a JSON Web Token.
That convenience comes with a hard boundary: Base64 is reversible encoding, not encryption. The mapping is public and needs no key, so anyone who receives the string can decode it back to the original bytes in seconds. Reach for it when the goal is safe transport or storage inside a text field, and never when the goal is confidentiality — secrets must be encrypted before any encoding step, and the result should not be treated as secret just because it looks scrambled.
The tool runs both directions. Paste text to encode it, or paste a Base64 string to decode it back to the original text or bytes, with the result shown immediately. The quirks that trip people up — trailing equals signs, the “+/” alphabet versus the URL-safe variant, and the size overhead — are covered below.
Inlining Images in HTML and CSS
A data URI such as data:image/png;base64,iVBORw0KGgo… embeds the image bytes directly in the document, so the browser already has the asset when the HTML arrives and never issues a second network request. That saves a round trip and genuinely helps for small, frequently used images — a favicon, a compact logo, a handful of icons, or a signature graphic in an email — where the extra bytes cost less than a connection.
The trade-off grows with the asset. Base64 inflates data by about one third (four output characters for every three input bytes), an inlined image cannot be cached separately or shared between pages, and a large image turns the HTML or CSS itself into a heavy payload that delays rendering. The reliable rule is to inline only small decorations and serve photographs and large graphics as normal files with cache headers, which the browser fetches and caches far more efficiently.
Frequently asked questions
Why does my Base64 string end with equals signs?
Equals signs are padding, not part of the data. Base64 encodes three input bytes as exactly four output characters, so whenever the input length is not a multiple of three the final group is short, and one or two “=” characters pad the output back to a multiple of four. One remaining byte produces two characters plus “==”; two remaining bytes produce three characters plus “=”. Decoders tolerate missing padding, which is why URL-safe uses such as JWT segments drop it entirely and swap “+” and “/” for “-” and “_”.
Your text never leaves your browser
Every tool runs locally on your device. Nothing you paste is uploaded, stored, or tracked.