Someone sends you a logo and the file is strangely small, a few kilobytes. You open it expecting a thumbnail and it fills your screen, perfectly sharp; you zoom in and it stays sharp. Then a website refuses the file and asks for a PNG instead, and the PNG you export at the wrong size comes out blurry. All three puzzles have the same explanation: an SVG is not a picture, but a set of drawing instructions written as text.
This guide explains what an SVG file is, why it behaves so differently from a photo, and how to turn one into a PNG at the exact size you need with the free SVG to PNG Converter on Ovatly.
Contents
- Quick answer
- An image made of instructions, not pixels
- Vector vs raster: why one scales and the other blurs
- The size declaration:
viewBox,widthandheight - Why so many places still ask for PNG
- A safety note: markup can carry active content
- How to turn an SVG into a PNG, step by step
- Worked example: one file, every size
- Limitations and honest tradeoffs
- Common mistakes
- FAQs
- Conclusion
- References
Quick answer
An SVG file is text markup that describes shapes: lines, curves, fills and text, with their positions and colors. Software reads those instructions and draws the picture fresh at whatever size is needed, which is why an SVG scales without blurring. A PNG or JPEG stores a fixed grid of pixels instead. When a place demands a bitmap, open the SVG to PNG Converter, paste the markup or load the file, set the output width, and download a PNG rendered at exactly that size.
An image made of instructions, not pixels
Open an SVG in a text editor and you will not see picture data. You will see readable markup, much like the code of a simple web page. An outer <svg> element wraps the artwork, and inside it, elements such as <rect>, <circle> and <path> describe each shape: where it sits, how big it is, and what color fills it. Text in the artwork is described with a <text> element, again as characters and instructions, not baked-in pixels.
The file does not contain the drawing; it contains the recipe for the drawing. Any program that understands the format can cook the recipe at any size, always drawn from the original instructions, never copied from a smaller finished picture.
Vector vs raster: why one scales and the other blurs
Graphics come in two families. Raster images (PNG, JPEG, and every photo your phone takes) store a grid of pixels with a fixed number of rows and columns. Vector images, of which SVG is the standard web format, store shapes as mathematical descriptions.
Scale a raster image up and the grid has to stretch: the software invents in-between pixels, and edges go soft. Scale a vector up and there is nothing to stretch, because the shapes are redrawn from their descriptions at the new size. That is why logos, icons and illustrations are kept as SVG masters: the same tiny file serves a browser tab and a billboard.
The trade runs the other way for photographs: a photo has no shapes to describe, just millions of varying pixels, so it belongs in raster formats.
The size declaration: viewBox, width and height
If an SVG can be any size, how does software know what shape it is? The file declares it. The width and height attributes state a size directly, and the viewBox attribute defines the internal coordinate system: viewBox="0 0 100 50" means the canvas runs 100 units wide and 50 units tall, so the artwork's proportions are two to one at any drawn size.
This declaration is not optional decoration. The SVG must declare a size, through width and height attributes or a viewBox. Without one, the Ovatly converter asks you to add it rather than guessing an output size, because guessing wrong would distort the artwork. When you convert, you set the output width in pixels and the height follows the declared aspect ratio.
Why so many places still ask for PNG
If SVG is so capable, why does anything refuse it? Because support is not universal. Many upload forms, office documents and older systems only accept bitmap formats. PNG is the safe common denominator: every system reads it, and it looks the same everywhere.
The practical workflow: keep the SVG as the master and produce PNGs as needed, each rendered at the exact width its destination wants. A logo shown at 300 px wide on a website wants a 600 px PNG, double the display size, to stay crisp on high-density screens.
A safety note: markup can carry active content
Because an SVG is markup, it can contain more than shapes: scripts and event handlers can ride along inside the file, which matters when you convert files from sources you do not control. Before rendering, the Ovatly converter sanitizes the markup: scripts, event handlers and other active content are removed, so a downloaded SVG cannot smuggle code into the render.
A related rule: an SVG loaded as an image must be self-contained. Browsers block external fonts and linked images inside it, so those elements fail or go missing in a render. If pieces of your artwork vanish during conversion, an external reference is almost always why; embed the asset inside the file and convert again.
How to turn an SVG into a PNG, step by step
- Open the SVG to PNG Converter and paste your SVG markup, or choose the
.svgfile to load its code. - Set the output width in pixels, matching where the PNG will be used; double the display width for crisp results on high-density screens.
- Choose a background: transparent, white or black.
- Convert, check the preview for missing pieces, and download the PNG.
Worked example: one file, every size
Take an SVG with a viewBox of 0 0 100 50 and no width or height attributes. The declaration says the artwork is twice as wide as it is tall. Convert it at an output width of 1024 px and the PNG is exactly 1024 by 512 px, because the height follows the two-to-one ratio. Convert the same file at 300 px wide and you get 300 by 150 px, just as sharp, because both renders were drawn fresh from the same instructions.
The habit to build: never enlarge a PNG export when you need a bigger one; go back to the SVG and render again at the new width.
Limitations and honest tradeoffs
An SVG must declare its size and be self-contained to render correctly. Not every program accepts the format, which is why conversion exists at all. Conversion is a one-way snapshot: the PNG is fixed at the width you chose, so the SVG remains the master worth keeping. SVG suits artwork built from shapes, not photographs, and turning a photo into SVG markup is not something this converter does.
Common mistakes
- Assuming every program accepts SVG. Many forms, documents and older tools do not. Keep the SVG as the master and export PNGs for those destinations.
- Converting an SVG with external references. A linked font or image is blocked and disappears from the render. Embed assets inside the file first.
- Deleting the SVG after one export. The next size you need has to come from the vector, not from a folder of old PNGs.
- Expecting an SVG with no declared size to convert cleanly. Without
widthandheightattributes or aviewBox, the tool will ask you to add one rather than guess.
FAQs
What does SVG stand for? Scalable Vector Graphics. Scalable is the point: the same file can be drawn tiny on a phone or huge on a poster without losing sharpness, because it stores drawing instructions rather than pixels.
Why does an SVG stay sharp at any size? The file describes shapes in markup, and the viewer redraws them at whatever size is requested. There is no fixed pixel grid to stretch, so edges stay clean at every size.
Why do some places ask for a PNG instead of an SVG? Many upload forms, office documents and older systems only accept bitmap formats like PNG. Converting the SVG to a PNG at the exact width you need keeps the artwork as sharp as the vector allows.
Why does an SVG need a viewBox or width and height? Those attributes declare the artwork's size and proportions. Without one, a converter cannot know the intended shape, so the Ovatly converter asks you to add it rather than guessing an output size.
Can an SVG file contain harmful code? SVG is markup, so it can carry scripts and event handlers. The Ovatly converter sanitizes the markup before rendering, removing active content, and everything runs in your browser with nothing uploaded.
Conclusion
An SVG is a recipe, not a photograph: text instructions that any supporting program draws at any size. Keep yours as the master file, and when a destination demands a bitmap, the SVG to PNG Converter renders a PNG at the exact width you set, in your browser. When print is the destination, our guide to exporting an SVG at high resolution for print covers how wide to go. For more guides in this series, see our Image Tools guides.
References
- MDN Web Docs, SVG documentation and tutorials: https://developer.mozilla.org/en-US/docs/Web/SVG
- W3C, SVG 2 specification: https://www.w3.org/TR/SVG2/