Inline a small SVG
A valid SVG starts with an svg element, comments are removed, and the remaining markup is percent-encoded after the data:image/svg+xml prefix.
<svg viewBox="0 0 10 10"> -> data:image/svg+xml,%3Csvg...Paste SVG markup to create a compact data:image/svg+xml URI for CSS or HTML, or decode an SVG data URI back to markup.
Convert SVG markup to a CSS/HTML-safe data URI and back.
Fill in the values, paste your text, or upload the file this tool works with.
Most tools update live as you type; a few use a single button. Either way, the result appears right on this page.
Copy, download, or share what the tool produces — you're always in control of the output.
Encode SVG markup into a Data URI for CSS or HTML, or decode an existing SVG Data URI back to markup.
SVG Data URIs are useful for small inline icons, CSS backgrounds, and compact prototypes.
Data URIs work best for small SVGs. Large illustrations are usually easier to maintain as separate files.
A valid SVG starts with an svg element, comments are removed, and the remaining markup is percent-encoded after the data:image/svg+xml prefix.
<svg viewBox="0 0 10 10"> -> data:image/svg+xml,%3Csvg...Data URIs are convenient for small SVGs. Once the encoded string gets long, a separate .svg file is usually easier to cache, read, and maintain.
Yes. The encoded output is ready for CSS url(...) usage or HTML attributes.
No. It converts text only, so review SVGs from untrusted sources before using them.
It is focused on SVG Data URIs, not arbitrary file formats.
Only comments and outer whitespace are removed. Internal text spacing is preserved so the SVG does not change visually.
Check foreground and background contrast for UI work.
Calculate proportional width or height for media and UI.
Generate clamp(), gradients, shadows, border radius, and grid CSS.
Extract dominant HEX and RGB colors from an image.
Remove extra SVG metadata, comments, and whitespace.
Calculate and compare CSS selector specificity.
Generate a font size scale from a base size and ratio.
Preview an image under common color vision deficiency modes.
Calculate screen PPI, dot pitch, physical dimensions, and visual sharpness.
Create a polished signature with live preview.