Skip to main content
🇪🇸 Español 🇧🇷 Português 🇩🇪 Deutsch
Image Converter Video Converter Audio Converter Document Converter
Tools Guides Formats Pricing API
Log In
Guide

SVG Format: The Complete Technical Guide

PC By Pablo Cirre

Related conversions

Put what you just learned into practice — convert your files now in seconds, free and without registration.

Frequently Asked Questions

Yes. SVG is XML and can contain embedded JavaScript (`<script>` elements), external resource references, and event handlers (`onclick`, `onload`). When an SVG is served from a different origin than the page or embedded via `<img>`, browsers sandbox it and block script execution. However, inline SVG in HTML runs in the same context as the page and can execute scripts. Always sanitize untrusted SVG content using a library like DOMPurify before rendering it inline. SVG from untrusted sources should be served as `Content-Type: image/svg+xml` with appropriate CSP headers, never embedded inline without sanitization.

Yes. SVG is XML e can contain embedded JavaScript (`<script>` elements), external resource references, e event handlers (`onclick`, `onload`). When an SVG is served de a different origin than the page ou embedded via `<img>`, browsers sandbox it e block script execution. Porém, inline SVG in HTML runs no same context como o page e can execute scripts. Always sanitize untrusted SVG content usando a library like DOMPurify antes rendering it inline. SVG de untrusted sources should be served as `Content-Type: image/svg+xml` com appropriate CSP headers, never embedded inline sem sanitization.

Yes. SVG is XML und can contain embedded JavaScript (`<script>` elements), external resource references, und event handlers (`onclick`, `onload`). When an SVG is served von a different origin than the page oder embedded via `<img>`, browsers sandbox it und block script execution. Jedoch, inline SVG in HTML runs im same context als das page und can execute scripts. Always sanitize untrusted SVG content using a library like DOMPurify vor rendering it inline. SVG von untrusted sources should be served as `Content-Type: image/svg+xml` mit appropriate CSP headers, never embedded inline ohne sanitization.

Yes. SVG is XML y can contain embedded JavaScript (`<script>` elements), external resource references, y event handlers (`onclick`, `onload`). When an SVG is served de a different origin than the page o embedded via `<img>`, browsers sandbox it y block script execution. Sin embargo, inline SVG in HTML runs en el same context como el page y can execute scripts. Always sanitize untrusted SVG content using a library like DOMPurify antes rendering it inline. SVG de untrusted sources should be served as `Content-Type: image/svg+xml` con appropriate CSP headers, never embedded inline sin sanitization.

Use <strong>lossy</strong> (JPG, WebP, AVIF) for photographs — the human eye barely notices the difference at quality 80–85, and file sizes are 5–20× smaller. Use <strong>lossless</strong> (PNG, WebP-lossless) for screenshots, UI mockups, logos and anything with sharp edges or text — lossy creates ugly artifacts around boundaries.

The viewBox attribute defines the internal coordinate system of an SVG independently from its displayed size. Format: `viewBox="minX minY width height"`. For example, `viewBox="0 0 100 100"` means the SVG's internal coordinate space is 100×100 units. If you then display the SVG at 500×500 pixels, everything scales proportionally — a circle drawn at radius 50 units fills exactly half the display area. Without viewBox, the SVG's coordinate space equals its pixel dimensions, making responsive scaling difficult. Always include viewBox for icons and responsive graphics.

The viewBox attribute defines the internal coordinate system of an SVG independently de its displayed size. formato: `viewBox="minX minY width height"`. Por exemplo, `viewBox="0 0 100 100"` means the SVG's internal coordinate space is 100×100 units. If you then display the SVG at 500×500 pixels, everything scales proportionally — a circle drawn at radius 50 units fills exactly half the display area. sem viewBox, the SVG's coordinate space equals its pixel dimensions, making responsive scaling difícil. Always include viewBox para icons e responsive graphics.

The viewBox attribute defines the internal coordinate system von an SVG independently von its displayed size. Format: `viewBox="minX minY width height"`. Zum Beispiel, `viewBox="0 0 100 100"` means the SVG's internal coordinate space is 100×100 units. If you then display the SVG at 500×500 pixels, everything scales proportionally — a circle drawn at radius 50 units fills exactly half the display area. ohne viewBox, the SVG's coordinate space equals its pixel dimensions, making responsive scaling schwierig. Always include viewBox für icons und responsive graphics.

The viewBox attribute defines the internal coordinate system de an SVG independently de its displayed size. formato: `viewBox="minX minY width height"`. Por ejemplo, `viewBox="0 0 100 100"` means the SVG's internal coordinate space is 100×100 units. If you then display the SVG at 500×500 pixels, everything scales proportionally — a circle drawn at radius 50 units fills exactly half the display area. sin viewBox, the SVG's coordinate space equals its pixel dimensions, making responsive scaling difícil. Always include viewBox para icons y responsive graphics.

For new projects in 2026, WebP is supported by all modern browsers (95%+ of traffic) and saves 25–35% over JPG at the same visual quality. AVIF is even more efficient (40–50% smaller) but encoding is slower and Safari support is recent. Use WebP as the default and AVIF as the progressive enhancement via <code>&lt;picture&gt;</code> with JPG fallback.

Define symbols in a hidden SVG and reference them with `<use>`. Create a sprite file: `<svg style="display:none"><symbol id="icon-home" viewBox="0 0 24 24"><path d="..."/></symbol></svg>`. Then reference anywhere: `<svg width="24" height="24"><use href="#icon-home"/></svg>`. For external sprite files: `<use href="sprites.svg#icon-home"/>`. CSS can style the referenced icons via `fill: currentColor` inheritance. This pattern loads all icons in one HTTP request and allows different sizes and colors per instance. Tools like SVGR and Vite's SVG plugin automate this for React/Vue projects.

Define symbols em um hidden SVG e reference them com `<use>`. Create a sprite file: `<svg style="display:none"><symbol id="icon-home" viewBox="0 0 24 24"><path d="..."/></symbol></svg>`. Then reference anywhere: `<svg width="24" height="24"><use href="#icon-home"/></svg>`. para external sprite files: `<use href="sprites.svg#icon-home"/>`. CSS can style the referenced icons via `fill: currentColor` inheritance. This pattern loads all icons in one HTTP request e permite different sizes e colors per instance. ferramentas like SVGR e Vite's SVG plugin automate this para React/Vue projects.

Define symbols in einem hidden SVG und reference them mit `<use>`. Create a sprite file: `<svg style="display:none"><symbol id="icon-home" viewBox="0 0 24 24"><path d="..."/></symbol></svg>`. Then reference anywhere: `<svg width="24" height="24"><use href="#icon-home"/></svg>`. für external sprite files: `<use href="sprites.svg#icon-home"/>`. CSS can style the referenced icons via `fill: currentColor` inheritance. This pattern loads all icons in one HTTP request und erlaubt different sizes und colors per instance. Werkzeuge like SVGR und Vite's SVG plugin automate this für React/Vue projects.

Define symbols en un hidden SVG y reference them con `<use>`. Create a sprite file: `<svg style="display:none"><symbol id="icon-home" viewBox="0 0 24 24"><path d="..."/></symbol></svg>`. Then reference anywhere: `<svg width="24" height="24"><use href="#icon-home"/></svg>`. para external sprite files: `<use href="sprites.svg#icon-home"/>`. CSS can style the referenced icons via `fill: currentColor` inheritance. This pattern loads all icons in one HTTP request y permite different sizes y colors per instance. herramientas like SVGR y Vite's SVG plugin automate this para React/Vue projects.

It depends on the tool: ImageMagick and FFmpeg copy EXIF by default, while cwebp drops it unless you pass <code>-metadata all</code>. KaijuConverter strips metadata server-side after conversion to protect your privacy — if you need to keep camera or GPS data, use a desktop tool you control.

Common causes: (1) External fonts not loaded by the export engine — use embedded base64 fonts or system fonts. (2) CSS variables (`var(--color)`) not resolved by server-side SVG renderers (Inkscape, librsvg, Puppeteer). (3) `filter` effects rendering differently between engines. (4) `viewBox` or `preserveAspectRatio` mismatches causing cropping. (5) External `href` references to images or gradients in other files not accessible to the renderer. For reliable PNG export, use Puppeteer (headless Chrome) which uses the same rendering engine as Chrome, or export directly from the design tool.

Common causes: (1) External fonts not loaded pelo export engine — usar embedded base64 fonts ou system fonts. (2) CSS variables (`var(--color)`) not resolved by server-side SVG renderers (Inkscape, librsvg, Puppeteer). (3) `filter` effects rendering differently between engines. (4) `viewBox` ou `preserveAspectRatio` mismatches causing cropping. (5) External `href` references to images ou gradients in other arquivos not accessible para o renderer. para reliable PNG export, usar Puppeteer (headless Chrome) which uses the same rendering engine as Chrome, ou export directly de the design tool.

Common causes: (1) External fonts not loaded by the export engine — verwenden embedded base64 fonts oder system fonts. (2) CSS variables (`var(--color)`) not resolved by server-side SVG renderers (Inkscape, librsvg, Puppeteer). (3) `filter` effects rendering differently between engines. (4) `viewBox` oder `preserveAspectRatio` mismatches causing cropping. (5) External `href` references to images oder gradients in other Dateien not accessible zum renderer. für reliable PNG export, verwenden Puppeteer (headless Chrome) which uses the same rendering engine as Chrome, oder export directly von the design tool.

Common causes: (1) External fonts not loaded by the export engine — usar embedded base64 fonts o system fonts. (2) CSS variables (`var(--color)`) not resolved by server-side SVG renderers (Inkscape, librsvg, Puppeteer). (3) `filter` effects rendering differently between engines. (4) `viewBox` o `preserveAspectRatio` mismatches causing cropping. (5) External `href` references to images o gradients in other archivos not accessible al renderer. para reliable PNG export, usar Puppeteer (headless Chrome) which uses the same rendering engine as Chrome, o export directly de the design tool.

Three common causes: (1) ICC color profiles dropped during conversion shift colors slightly; (2) chroma subsampling (4:2:0) reduces color accuracy in lossy JPG/WebP; (3) the new format may not support all features of the original (e.g. PNG → JPG drops transparency to white). For pixel-perfect results stick to lossless formats and preserve color profiles explicitly.

We use cookies and similar technologies to personalise content and ads, and to analyse traffic. Learn more about cookies.