SVG to Base64 encoder
Encode an SVG as base64 for places that need it — email templates, JSON payloads, APIs, older tools — as a ready data:image/svg+xml;base64 URI or as plain base64 without the prefix. Text with accents or emoji is encoded as UTF-8, so it decodes intact. Copy CSS and <img> snippets, encode a whole set into one stylesheet, or paste base64 to get the SVG back. For CSS on the web, the URL-encoded form is usually a third smaller; switch to it with one click.
How to use it
- 1
Drop an SVG (or several) or paste its code.
- 2
Copy the base64 data URI, the plain base64, or a CSS or <img> snippet.
- 3
Download icons.css for a set, or decode base64 back to SVG.
Questions
Base64 or URL-encoded for CSS?
URL-encoded is usually 20–25% smaller for SVG (base64 adds a third) and still works everywhere in CSS and HTML. Base64 is for places that require it: some email clients, JSON fields, APIs or tools that reject other characters.
Why does my base64 SVG show broken characters?
Base64 made with btoa alone breaks on characters outside Latin-1, like emoji or many accents. This encoder converts the text to UTF-8 bytes first, so every character survives the round trip.
How do I decode base64 back to SVG?
Open Decode a data URI, paste the data:image/svg+xml;base64 URI (or a CSS url(…) holding one), and copy or download the SVG.
Is my SVG uploaded?
No. Encoding and decoding run in your browser; nothing is sent anywhere.
More free SVG tools
Need more than one change?
The Splice editor edits SVGs visually — shapes, text, colors, layers — across many files at once, with the code in sync.
Open the editor