UtilToolkits2025-12-17
TL;DR — The Base64 Converter encodes and decodes any text or file in your browser. For inline images, use the Image to Base64 tool. For vector icons, the SVG to Data URI tool produces the most compact inline format.
Base64 is a binary-to-text encoding: it represents every 3 bytes of input as 4 ASCII characters drawn from A-Z a-z 0-9 + /. That’s it. It exists because many transport channels — email headers, URLs, JSON values, HTTP basic auth — only accept printable ASCII. Base64 lets you stuff arbitrary bytes through those channels.
What Base64 is not:
YWRtaW46cGFzc3dvcmQ= is "admin:password". Never use Base64 to "hide" secrets.background-image CSS without round-tripping a separate file.Authorization: Basic <base64(user:pass)> — required by the spec.+/= with -_).// JavaScript (browser + Node)
btoa('admin:password'); // → 'YWRtaW46cGFzc3dvcmQ='
atob('YWRtaW46cGFzc3dvcmQ='); // → 'admin:password'
// Python
import base64
base64.b64encode(b'admin:password') // → b'YWRtaW46cGFzc3dvcmQ='
// Command line
echo -n 'admin:password' | base64
echo 'YWRtaW46cGFzc3dvcmQ=' | base64 -d
Standard Base64 uses +, /, and = — all of which have special meaning in URLs. The URL-safe variant (RFC 4648 §5) swaps in -, _ and drops padding. JWTs and most modern APIs use URL-safe; legacy systems (SMTP, MIME) use standard. The Base64 Converter has a toggle so you don’t have to remember which is which.
/* Bad: each icon = one HTTP request */
.icon-search { background: url('/icons/search.png'); }
/* Good for tiny icons under 2 KB: zero requests */
.icon-search {
background: url('data:image/png;base64,iVBORw0KGgoAAAANSU...');
}
Use the Image to Base64 tool to generate the full data:image/...;base64, URI ready to paste. For SVG icons, the SVG to Data URI tool produces a non-Base64 encoding that’s typically smaller than the Base64 equivalent.
Everything encoded or decoded here stays in your browser tab. That matters because the most common Base64 use case in real life is debugging JWTs, API keys, or HTTP basic auth headers — exactly the strings you should never paste into a website that POSTs to an unknown server.
No. It’s a reversible encoding, not encryption. If you can read this sentence, you can decode any Base64 string.
That’s the fundamental cost — 3 bytes → 4 characters. If size matters, use gzip or brotli on the underlying binary before Base64.
= at the end mean?Padding. Base64 output length must be a multiple of 4; = fills any shortfall. URL-safe variants typically omit it.
Split on ., take the first two parts, and decode each as URL-safe Base64. Or use a dedicated JWT debugger — much faster than doing it by hand.
No. The HTTP-request savings only matter for tiny assets (under ~2 KB). For anything bigger, the 33% overhead and loss of HTTP caching make it slower overall.