SVG to PNG
Rasterise an SVG to a PNG at a chosen scale, locally in your browser.
- Runs locally in your browser
- No upload required
Capabilities
- Drag and drop
- Local file intake
- Download result
Try it
Supported formats
Privacy
Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.
Rasterise a 24×24 SVG to a 48×48 PNG at scale 2.
How it works
- Sanitize the SVG: remove scripts, event handlers, foreignObject and external references.
- Decode it as an image and paint it into a 48×48 canvas.
- Encode the canvas as PNG (lossless) and offer it for download.
- The export runs in your browser; the SVG is never uploaded.
Methodology
- Sanitize the SVG source before rasterising so scripts, event handlers, foreignObject and external references cannot execute.
- Resolve the export size as the SVG's intrinsic size multiplied by the requested scale, clamped to the safe pixel bounds.
- Decode the sanitized SVG as an image, paint it into a canvas of that size and encode a lossless PNG.
Usage
- Choose or drop an SVG file.
- Set the scale factor (2 gives a 2× export).
- Run the export and download the PNG.
Examples
These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.
24×24 icon at scale 2
{
"svgWidth": 24,
"svgHeight": 24,
"scale": 2
}300×150 logo at scale 1
{
"svgWidth": 300,
"svgHeight": 150,
"scale": 1
}Limitations
Sanitise, then rasterise
An SVG can carry scripts and external references. The exporter sanitizes the source with the same conservative rules as the SVG viewer, then decodes the cleaned markup as an image and paints it onto a canvas.
The export size is the SVG's intrinsic size times the scale factor, so a 24×24 icon at scale 2 produces a 48×48 PNG.
Frequently asked questions
- Is the transparent background preserved?
- Yes. PNG keeps the SVG's transparency; areas without a fill stay transparent.
- Why is a script inside my SVG removed?
- Scripts are a security risk, so the sanitizer strips them, along with event handlers, foreignObject and external references, before the SVG is rasterised.
Sources
Send feedback
Tell us if this tool helped, report a problem, or suggest a tool. Only the message you type is sent — never the input you used in the tool.
Was this tool useful?
Prefer to write to us directly? See the contact page.