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

Read locally in your browser; never uploaded.

2 exports at twice the SVG's intrinsic size.

Choose a file, then run the tool. Everything happens in your browser.

Supported formats

Input
svg, image/svg+xml
Output
image/png
Files
Local file intake and drag/drop

Privacy

Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.

Processing
In your browser
Privacy level
Browser only

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

  1. Sanitize the SVG source before rasterising so scripts, event handlers, foreignObject and external references cannot execute.
  2. Resolve the export size as the SVG's intrinsic size multiplied by the requested scale, clamped to the safe pixel bounds.
  3. Decode the sanitized SVG as an image, paint it into a canvas of that size and encode a lossless PNG.

Usage

  1. Choose or drop an SVG file.
  2. Set the scale factor (2 gives a 2× export).
  3. 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

jsonSelect to copy
{
  "svgWidth": 24,
  "svgHeight": 24,
  "scale": 2
}

300×150 logo at scale 1

jsonSelect to copy
{
  "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

  1. Scalable Vector Graphics (SVG) 1.1 Specification — W3C