Developer Tools
SVG to PNG/JPG Rasterizer - Convert SVG to Image Online
Convert SVG files to PNG or JPEG raster images in your browser. Choose scale factor and background color - no upload, instant download.
Convert SVG to PNG or JPEG in your browser
This tool renders any SVG file to a raster image (PNG or JPEG) directly in your browser using the HTML Canvas API. No server, no upload. Paste or load an SVG and download the output instantly.
How to use
- Paste your SVG code into the input, or click Load .svg file to open a file.
- Choose the output format (PNG for lossless, JPEG for smaller files).
- Select a scale factor: 2× or 3× gives crisp results on high-DPI screens.
- Optionally set a background color (transparent is only valid for PNG).
- Click Download to save the rasterized image.
Format comparison
| Format | Best for | Transparency |
|---|---|---|
| PNG | Logos, icons, UI assets: any image needing pixel-perfect quality | Yes (alpha channel) |
| JPEG | Photos, illustrations with gradients where file size matters | No |
Scale factor guide
| Scale | Use case |
|---|---|
| 1× | Standard screen density: exact pixel size from SVG dimensions |
| 2× | Retina / HiDPI screens: recommended default |
| 3× | Print or very high-DPI output |
| 4× | Large-format print; note: very large canvases may be slow |
SVG dimension detection
The tool reads the output dimensions from the SVG's width and
height attributes first. If those are absent, it falls back to the
viewBox dimensions. If neither is present, it defaults to 300×150 px.
Common use cases
- Mobile app assets: Android and iOS require PNG icon assets at multiple resolutions (mdpi 1×, hdpi 1.5×, xhdpi 2×, xxhdpi 3×). Rasterize the same SVG at 1×, 2×, and 3× to generate the full set from one source file.
- Open Graph / social preview images: many social platforms do not support SVG in OG image meta tags. Convert your SVG template to a 1200×630 PNG for sharing.
- Legacy platforms: older email clients, some CMS image fields, and certain document formats do not accept SVG. PNG is universally supported.
Canvas tainting and external resources
If your SVG references external resources - fonts loaded from Google Fonts, images from another domain, or stylesheets - the browser's Canvas API will block rasterization for security reasons (this is called "canvas tainting"). The download button will be disabled or produce a blank/broken image.
The fix is to embed all resources inline before rasterizing: convert external fonts to Base64
data URIs, embed image data as data: URLs inside the SVG, and inline any referenced
CSS. SVG files exported from Figma or Illustrator with embedded content rasterize without issues.