Use base64 when you need to transmit binary data through a text-only channel — embedded SVG in CSS (data:image/svg+xml;base64,…), JWT payloads, email attachments (MIME). Don't use it for compression: base64 inflates data by ~33%. For in-HTML inlining, it can eliminate an HTTP request but increases bytes on the wire.
Last updated: 2026-04-22