Encode SVG files to Base64 Data URIs, CSS rules, or decode Base64 back to SVG
Drop an SVG to encode it to Base64
Get a Base64 Data URI, raw Base64, CSS rule, or <img> tag. Or press Ctrl/⌘ V to paste an SVG or Data URI. Nothing leaves your browser.
Generate full Base64 Data URIs, raw Base64 strings, compact UTF-8 URIs, CSS background-image or mask rules, and HTML <img> tags in one click.
Convert .svg files to Base64 or paste an existing data:image/svg+xml string to decode it back into a clean, downloadable SVG file.
Uses native UTF-8 TextEncoder and btoa() inside your browser—zero server uploads, instant batch ZIP exports, and automatic minification.
Need to inline a small SVG icon inside a CSS stylesheet, JSON config, email template, or HTML <img> tag without an extra HTTP request? This free SVG to Base64 converter encodes your vector files locally in your browser into properly UTF-8 encoded Base64 Data URIs, compact URL-encoded UTF-8 URIs, or ready-to-paste CSS rules. You can also paste any Base64 SVG string to decode and preview it immediately.
Embed small UI icons directly in CSS background-image or mask properties to eliminate network requests.
Use a self-contained data:image/svg+xml;base64 URI wherever a standard image URL is expected.
Encode vector logos or badges into clean, ASCII-safe Base64 strings for APIs and static bundles.
Paste an encoded Data URI from DevTools or CSS to inspect the visual graphic and export it back as an .svg file.
Encode any SVG file into a Base64 Data URI in three steps:
Base64 adds ~33% size overhead. For simple icons, the UTF-8 URI format is often smaller and gzip-compresses better in CSS files.
Small icons inline cleanly in CSS, while large illustrations are better served as standalone .svg files so browsers can cache them separately.
An SVG inside background-image cannot inherit CSS text color. Switch to the CSS Mask format to style monochrome icons with color.
More free browser-based vector converters and editors in MintConvert.
Turn SVG into clean HTML, JSX, React, Vue, Svelte or CSS code
Generate crisp vector QR codes with custom shapes, colors and logos
Generate crisp vector barcodes (CODE128, EAN-13, UPC, Code 39) as SVG
Export 1x–8x high-DPI transparent PNGs from vector files
Trace PNG, JPG and WebP images into clean, scalable SVG paths
Convert SVG to PNG, JPG, WebP or ICO in one workspace