You have a clean piece of vector artwork and a destination that will not take it. The upload form accepts PNG only, the document needs a bitmap, or the app store listing rejects SVG outright. So you convert, guess a size, and end up with a PNG that is either too small and soft or far bigger than the slot will ever show.
Converting SVG to PNG is really one decision: how wide the pixel grid should be. This guide explains why the width is the only number you set, how the height works itself out, and how to pick the right width with the free SVG to PNG Converter on Ovatly, which renders in your browser and never uploads your file.
Contents
- Quick answer
- Why a PNG needs a size and an SVG does not
- Width is the one number you set
- Which width do you actually need?
- How to convert SVG to PNG, step by step
- Worked example: a 100 by 50 artwork at 1024 px
- Limitations and honest tradeoffs
- Common mistakes
- FAQs
- Conclusion
- References
Quick answer
To convert an SVG to a PNG at a specific size: decide the pixel width the image will actually be used at, double it for retina screens, and enter that width in the converter. On Ovatly, open the SVG to PNG Converter, paste your SVG markup or open the .svg file, set the output width in pixels, choose a transparent, white or black background, and download the PNG. The height follows the artwork's own aspect ratio, so the shape can never come out distorted.
Why a PNG needs a size and an SVG does not
An SVG is a set of drawing instructions: lines, curves and shapes described in markup, drawn fresh at whatever size they are shown. It has no fixed pixel grid of its own, which is why the same file can serve as a tiny icon and as a banner without losing sharpness.
A PNG is the opposite: a fixed grid of pixels, so many wide and so many tall. Converting means choosing that grid. Render the vector at a large width and the PNG holds plenty of detail; render it small and the detail is gone for good, because the PNG keeps only the pixels it was given. The original SVG keeps everything, which is why every size you need should be rendered from the SVG itself, never stretched up from a smaller PNG.
Width is the one number you set
In the converter you set the output width in pixels, and only the width. The height follows the artwork's own aspect ratio: a wide, short artwork produces a wide, short PNG, and a square one produces a square PNG. There is no height field to get wrong, and no way to squash the artwork into a shape it never had.
That ratio comes from the size the SVG declares for itself, through its width and height attributes or its viewBox. If the file declares no size at all, the tool asks you to add one rather than guessing. A quick look at the top of the markup tells you which case you are in: a viewBox such as viewBox="0 0 100 50" means the file knows its own shape and you are ready to convert.
Which width do you actually need?
Start from the width the image will actually display at, not the biggest number you can think of. A diagram shown at 800 px wide in an article needs an 800 px render for a standard screen. Anything larger is file weight nobody sees; anything smaller will be stretched by the browser to fill the slot, and a stretched bitmap looks soft.
Then apply the retina rule: for screens with high pixel density, double the display width. A logo shown at 300 px wide wants a 600 px PNG. The extra pixels keep edges crisp on those displays, and on a standard screen the same file displays at its intended size. Doubling is the one case where rendering larger than the slot is worth the weight.
If a form or marketplace states a required pixel size, that number wins over every rule of thumb. Match it exactly.
How to convert SVG to PNG, step by step
- Open the SVG to PNG Converter and paste your SVG markup into the box, or choose the
.svgfile to load its code. - Set the output width in pixels: the display width, doubled if the image will appear on retina screens.
- Choose the background: transparent, white or black. Transparent keeps any see-through parts of the artwork; a solid color fills them.
- Convert, check the preview, and download the PNG. If pieces are missing in the preview, the limitations section below explains the usual cause.
Worked example: a 100 by 50 artwork at 1024 px
Take an SVG whose markup declares viewBox="0 0 100 50" and no width attributes. Its intrinsic shape is 100 units wide by 50 units tall: twice as wide as it is tall.
Set the output width to 1024 px and the converter renders a PNG that is exactly 1024 by 512 px: the height is the width scaled by the same 2 to 1 ratio. The result is sharp because the vector is rendered fresh at that width, not scaled up from a small bitmap rendered earlier.
Run the same thinking in the other direction: if that artwork will sit in a page at 512 px wide, a retina screen wants a 1024 px render, which is the one you just made. How wide it will be shown is the whole question.
Limitations and honest tradeoffs
The PNG is one fixed size, chosen at the moment you convert. It serves the slot you rendered it for, and no other. If you need a much larger version later, convert again from the SVG: enlarging a finished PNG spreads the pixels it already has over a bigger area and looks soft.
The SVG has to be self-contained. Loaded as an image, it cannot pull in outside help: browsers block external fonts and linked images inside it, so those elements fail or go missing in the render. If your artwork uses a special font or a placed image, embed that asset inside the file first, as a data: URI, and convert again.
Before rendering, the markup is sanitized: <script> elements, event handlers such as onclick, and other active content are removed. That is a safety feature: an SVG downloaded from the internet cannot smuggle code into the render. It also means an SVG that relies on scripting for its appearance will not render the way its author saw it.
Common mistakes
- Rendering at display width for a retina slot. The image looks fine on your standard monitor and soft on every modern phone. Double the width for high-density screens.
- Enlarging the PNG instead of reconverting. The SVG is the master. Every size starts from it, never from a smaller PNG.
- Leaving fonts and images linked. The render drops whatever the file points at instead of containing. Embed assets inside the markup first.
- Picking a huge width just in case. A 4000 px render for a 400 px slot is weight every visitor downloads for detail nobody can see.
- Guessing when the file declares no size. Add a
viewBoxorwidthandheightattributes to the markup; the tool will not invent a size for you.
FAQs
Why convert SVG to PNG at all? Many upload forms, office documents and older systems only accept bitmap formats like PNG. A PNG rendered at the exact size you need keeps the artwork as sharp as the vector allows.
What width should I pick? The width the image will actually display at, times two for retina screens. A logo shown at 300 px wide wants a 600 px PNG. On a standard screen it still looks right; on a retina screen it stays sharp.
Can I set the height as well? No. You set the width, and the height follows the artwork's own aspect ratio. That is deliberate: the shape of the vector cannot be distorted by a mismatched height.
My SVG rendered with missing pieces. Why? Almost always an external reference: a font loaded by URL, or an image linked instead of embedded. Browsers refuse to load those inside an image-context SVG. Embed the asset inside the file and convert again.
Is my SVG uploaded to a server? No. The markup is sanitized and rendered inside your browser, and the file never leaves your device.
Conclusion
Converting SVG to PNG comes down to one honest number: the width the image will actually be shown at, doubled for retina screens. The SVG to PNG Converter handles the rest in your browser, height included, and your SVG stays untouched as the master. If your artwork is a logo that has to keep its transparency, our guide to converting an SVG logo to PNG with a transparent background covers that job in full. For more guides in this series, see our Image Tools guides, which pair each technique with the free tool that performs it.
References
- MDN Web Docs, on SVG and how vector images are described and rendered: https://developer.mozilla.org/en-US/docs/Web/SVG
- MDN Web Docs, on image file types and the formats browsers support: https://developer.mozilla.org/en-US/docs/Web/Media/Guides/Formats/Image_types