Convert SVG code to data URIs for use in CSS background-image, HTML img tags, or inline embedding. Choose between URL-encoded (smaller) or Base64 format. Preview your SVG and copy ready-to-use code snippets.
SVG data URIs let you embed vector graphics directly in CSS or HTML without separate HTTP requests. This is especially useful for small icons, logos, and UI elements where the overhead of an HTTP request exceeds the file transfer time.
There are two encoding methods: URL-encoding (recommended for SVG) preserves readability and is typically smaller, while Base64 encoding produces a longer string but avoids potential parsing issues with special characters in some contexts.
URL-encoding is recommended for SVG. It produces smaller output (typically 20-30% smaller than Base64) and keeps the SVG partially readable. Use Base64 only if you encounter parsing issues with special characters in your specific context.
Make sure your SVG includes the xmlns attribute (xmlns='http://www.w3.org/2000/svg'). Also check that there are no unescaped special characters like # in color values, and that the SVG is well-formed XML.
There is no hard limit in modern browsers, but performance degrades with large data URIs. Keep SVG data URIs under 10KB for best results. For larger SVGs, use an external file served through a CDN.
Yes. You can store an SVG data URI in a CSS custom property (variable) and use it with url(). This is a great pattern for theming, letting you swap icons by changing a single variable value.
Codifique ou decodifique strings Base64 diretamente no seu navegador
Converta texto para Base64 ou decodifique Base64 para texto simples
Converta imagens para strings codificadas em Base64
Decodifique strings Base64 de volta para imagens visíveis
Codifique qualquer arquivo para uma string Base64
Decode any Base64 string back to its original file
Decodifique strings Base64 para documentos PDF
Decodifique e inspecione tokens JWT
Codifique ou decodifique URLs com codificação percentual
Converta caracteres especiais em entidades HTML
Converta entre formatos hex e Base64
Decode Base64 strings to plain readable text
Check if a string is valid Base64 encoding
Decode Base64 and pretty-print as formatted JSON
Generate Base64 data URIs from text or files
Convert Base64 strings to hexadecimal and back
Encode text to UTF-8 bytes or decode bytes to text