PNG icons look sharp on your laptop, then fuzzy on a retina phone or a 4K monitor. You end up exporting the same icon at 1×, 2× and 3×. SVG icons solve that: one small file that’s sharp at every size, loads fast and can even change colour with CSS. If you only have your icons as PNG or JPG, you can turn them into clean SVGs for free.
This guide shows how to convert icons to SVG, how to keep the files small, and three ways to use them on a website, including WordPress.
The quick answer
- Open Vexel, Doetra’s free image to SVG converter, and choose your icon image (PNG, JPG, WebP, GIF or BMP).
- Pick the Logo style for flat icons, or Illustration for icons with more colours.
- Check it with Outlines view, and reduce the colours if needed.
- In Export, turn on Compact SVG, then Download SVG or Copy code.
It’s free, with no sign-up, and your image never leaves your device.
Why SVG icons are better than PNG
| PNG icons | SVG icons | |
|---|---|---|
| Sharp on high-res screens | Only if you export 2× and 3× versions | Always, at any size |
| File size for a simple icon | Often 5–30 KB per size | Often 1–3 KB, one file |
| Change colour with CSS | No; you need a new image | Yes (inline SVG with currentColor) |
| Hover effects and animation | Limited | Easy with CSS |
| Best for | Photos and very detailed images | Icons, logos, simple illustrations |
Step by step: PNG icon to SVG
1. Start with the cleanest source
Use the largest, sharpest version of the icon you have, ideally on a plain or transparent background. Blurry or tiny source images give lumpy outlines.
2. Open it in Vexel
Go to doetra.com/image-to-svg and choose your image, drop it in, or paste it with Ctrl+V.
3. Pick the right style
- Logo: flat icons with a few solid colours. This usually gives the smallest, cleanest file.
- Illustration: icons with more colours or soft shapes.
- Grayscale: single-colour icons you plan to recolour with CSS.
- Pixel art: retro or pixel icons, kept as crisp squares.
Picking a style resets the sliders, so choose the style first, then fine-tune.
4. Check and tune
Switch to Outlines to see the actual shapes. An icon should have a handful of clean shapes, not hundreds of tiny bits. Use Tune and Colours to reduce detail and colour count. Fewer shapes means a smaller file. The shape count and file size show in the corner.
5. Export
Open Export and turn on Compact SVG, which rounds the numbers for a smaller file. Then Download SVG, Copy code to paste it straight into your HTML, or Copy data URL to use it in CSS.
Three ways to use SVG icons on a website
1. As an image
<img src="/icons/cart.svg" width="24" height="24" alt="Cart">The simplest option. Always set width and height, and write alt text for icons that carry meaning.
2. Inline, so CSS can colour it
Paste the SVG code directly into your HTML (Vexel’s Copy code). Replace the fill colour inside it with currentColor, and the icon takes on the text colour around it, including on hover:
.nav a { color: #093B56; }
.nav a:hover { color: #1590C4; }3. As a CSS background
Use Copy data URL and paste it into your CSS, which is handy for decorative icons:
.badge { background: url("data:image/svg+xml,...") no-repeat; }Using SVG in WordPress
WordPress blocks SVG uploads by default, because SVG files can contain code. Safer options:
- Use page builders’ icon or HTML widgets and paste the SVG code (Elementor’s HTML widget works).
- Use a trusted plugin that sanitises SVG uploads, and only upload SVGs you created yourself.
- For a site icon (the browser tab icon), make a favicon pack with Tabby instead.
Frequently asked questions
How do I convert a PNG icon to SVG?
Open it in Vexel, choose the Logo style, then export a compact SVG.
Why is my SVG file so big?
Too many shapes or colours. Use the Logo style, reduce colours, and turn on Compact SVG.
Can I change an SVG icon’s colour with CSS?
Yes, if it’s inline: set its fill to currentColor and control the colour with CSS.
Is it free?
Yes, with no sign-up, and the image stays on your device.
Try it: Turn your icons into SVG →