How to use
- icon.svg12 KB
Add an SVG file or code
- icon.svg12 KB → 4 KB
Check, then optimize with SVGO
- icon.svgOptimized SVGicon.pngSet the width
Convert to PNG, WebP, Base64 and more
Drop SVG files or click “Choose files” (several are fine), or paste code and click “Add pasted code”. “Try a sample” shows how it works.
On the Check tab, review size, viewBox, element count, embedded images and font references, plus any script, on* attribute, external reference or non-SVG element (iframe, object…) found. Save the cleaned copy if you need it.
On the Optimize tab, choose viewBox, IDs and decimal places, watch the before and after byte counts, and save the smaller SVG.
On the Convert tab, export PNG or WebP (by width or scale, with a background), a data URI, Base64, a CSS background, or React (JSX).
On the Format tab, pretty-print with indentation or collapse to one line, then copy or save.
What it does
Shown as an image, so scripts do not run
The preview loads the SVG as an image (an img with a blob: URL). In that mode scripts are not executed and external files are not loaded. Switch the background (checkerboard, white, black) and zoom 100–400%.
Detects risky parts and writes a cleaned copy
Lists script elements, on* attributes, javascript: URLs, http(s) and other external references, foreignObject, non-SVG elements such as iframe, object, embed and XHTML, CSS @import and external url(), ENTITY declarations and animations that rewrite href. The cleaned copy is made with DOMPurify (an SVG allow-list) and drops the items found and references to external resources. It is not a guarantee against every attack.
SVGO optimization with before/after bytes
Shrinks with SVGO (version pinned). Choose whether to keep the viewBox and IDs, drop width/height, and how many decimal places (0–8) to keep. Several files can be written out as one ZIP.
PNG, WebP and code output
Export PNG or WebP by width (px) or scale with a background, or turn the SVG into a data URI, Base64, a CSS background or React (JSX). JSX output converts class → className, stroke-width → strokeWidth and similar attribute names.
Everything stays on your device
Files and code are never sent anywhere, and your SVG code is never inserted into the page’s HTML.
Use cases
- Shrink an SVG from a designer before putting it on a website
- Check whether a downloaded SVG contains scripts or external references before opening it
- Turn an SVG logo into a PNG (2× or 3×) or WebP for places that do not accept SVG
- Use an icon as a CSS background, a data URI or a React component
- Pretty-print a hard-to-read one-line SVG exported by an editor
Supported formats
Input
Output
Capability matrix
| Feature | Support | Notes |
|---|---|---|
| Safe preview (background switch, 100–400% zoom) | Supported | — |
| List of size, viewBox, element count, embedded images, font and external references | Supported | — |
| Detect and remove script, on* attributes, javascript: URLs, external references, foreignObject, non-SVG elements | Supported | Only the items listed on the Check tab are detected; it is not a guarantee that nothing else is wrong |
| SVGO optimization (viewBox, IDs, decimal places) | Supported | — |
| Convert to PNG and WebP (width, scale, background) | Supported | Up to 8192 px per side and 40 million pixels; WebP only in supporting browsers |
| Convert to data URI, Base64, CSS background and React (JSX) | Supported | — |
| Format and single-line code | Supported | — |
| Export animation (SMIL / CSS) | Not supported | PNG and WebP are single still frames. Optimizing can change animations, so check the result |
| Outline text (turn text into shapes) | Not supported | When converting to an image, text uses fonts installed on your device; web fonts are not applied |
| Convert while loading external files (images, fonts, CSS) | Not supported | External references are not fetched. Embedded data: images work |
| Trace raster images (PNG, JPG) into SVG | Not supported | — |
Limits & notes
- Up to 2 MB per file, 10 MB in total and 20 files.
- PNG and WebP output is limited to 8192 px per side and 40 million pixels.
- Image export uses the SVG with scripts, external references and the other items found by the check removed.
- Optimizing or formatting can change animations or whitespace inside text. Check the result in the preview.
- If you embed SVG directly in a page, sanitize it on the server as well. The cleaned copy here is an aid for your own review.
- Phones and tablets can load, check and convert SVG too, but reading the code and comparing the check items and optimize settings is more reliable on a PC.
Privacy & safety
Loading, checking, optimizing and converting SVG all happen inside your browser. Files and code are never sent to or stored on a server. Neither the contents nor the original file names are included in usage measurement.
FAQ
Does optimizing an SVG change how it looks?
Can I check whether an SVG contains scripts?
How is the size decided when converting SVG to PNG?
Text in the converted PNG looks different
Can I turn an SVG into a data URI or a React component?
Is my SVG uploaded to a server?
Related tools
Image Converter
Choose the target format first, then drop images to convert them in bulk. Tune quality per format, use lossless WebP, set a background for transparency and name the output files — nothing is uploaded.
Color Converter, Contrast Checker & Palettes (Color Studio)
Type one color and see it in HEX, RGB, HSL, HWB, OKLCH and approximate CMYK. Check WCAG contrast against a background (AA/AAA), generate complementary or triadic schemes and a 50–950 OKLCH scale, preview how a palette looks with color-vision deficiency, and export CSS variables or Tailwind config. Nothing leaves your device.
Icon Generator
From one image (or a letter or emoji), get favicon.ico, apple-touch-icon, Android/PWA icons, a maskable icon and an OGP image, plus the manifest and the <head> code to paste. Check blur at real size first — nothing leaves your browser.
Image Compressor
Drop images to shrink them in bulk while keeping them sharp. Convert to WebP or AVIF, resize, and compare before and after. Your images are never uploaded.
Font Studio
Drop a font file to see its names, glyph count and character coverage (JIS levels, jōyō kanji and Unicode blocks), and preview any text. Compare fonts side by side, convert to WOFF2 or WOFF, or keep only the characters you list. Everything runs in your browser and the font is never uploaded.
Batch Image Resizer
Resizing is free: drop a batch of images and resize them by width, longest edge, box crop and more. To change pixel dimensions, type the width or long edge in px. Make several sizes (say 320, 640 and 1280) from each image in one go, then copy ready-made srcset HTML. Your images are never uploaded.
Last updated: