SVG Converter
Published Updated
Export an SVG as a PNG or JPEG at 1x to 4x, or at an exact pixel width and height.
Where the pixel size comes from
The tool reads the width and height of the root element first. Plain numbers and px are used as they are. The absolute units in, cm, mm, Q, pt and pc are converted at the CSS rate of 96 pixels per inch (CSS Values), so width="10cm" is 378 px, width="200mm" is 756 px and width="1in" is 96 px, the same size a browser draws. A percentage, em, ex or auto counts as not given. If both sides are missing, the third and fourth numbers of the viewBox are used. If only one side is given, the other follows the viewBox proportions. With no viewBox, a missing width becomes 300 and a missing height 150, so a file with only width="500" is 500 x 150.
Files from Inkscape and other editors often use millimeters. An A4 page written as 210mm x 297mm opens at 794 x 1,123 px, and the 1x to 4x buttons scale from there. You can still type any width you need, and with the aspect lock on the height follows.
Scale presets
The buttons multiply the size the tool detected.
| SVG size read | 1x | 2x | 4x |
|---|---|---|---|
| 24 x 24 (icon) | 24 x 24 | 48 x 48 | 96 x 96 |
| 200 x 100 (logo) | 200 x 100 | 400 x 200 | 800 x 400 |
| 800 x 600 (illustration) | 800 x 600 | 1600 x 1200 | 3200 x 2400 |
Exporting an SVG as a bitmap
Step 1
Add an SVG
Pick one .svg file. The preview and the width and height boxes show the size the tool worked out.
Step 2
Choose a size and a format
Press 1x, 2x, 3x or 4x, or type a width. Then choose PNG or JPEG.
Step 3
Convert and download
The file name ends in the scale, for example logo-2x.png. Check the pixel size on the result card.
What the renderer can and cannot draw
The tool rewrites the width and height, then lets the browser draw the SVG as an image. The MDN notes on SVG as an image list restrictions such as scripts being disabled and external resources not loading. In practice:
- Scripts do not run.
- External images, stylesheets and web fonts do not load. Data URIs inside the file do.
- Fonts that are not installed on your computer are replaced.
- Rendering follows your browser's own SVG engine, so rare features can differ from Illustrator or Inkscape.
PNG is the lossless choice, and JPEG is written at quality 0.92 on a white background. For the reverse, PNG to SVG only wraps a bitmap in SVG markup, and to shrink the SVG source itself use SVG Optimizer.
One logo at 1x, 2x and 4x
The test file is a hand-written 400 x 300 SVG: a gradient rounded rectangle, a circle, two thin diagonal strokes and a line of bold sans-serif text. We ran the tool's own size reading (lib/svgConverterSize.ts), canvas check (lib/canvasLimits.ts) and its width and height rewrite, then drew and exported it, in Chromium 153.0.8010.12 (the Playwright build, headless) and in Playwright's WebKit build (user agent Version/26.6, not the Safari app). The sizes below differ between the two engines.
| Scale | Pixels | Chromium PNG | Chromium JPEG | WebKit PNG | WebKit JPEG |
|---|---|---|---|---|---|
| 1x | 400 x 300 | 112,300 B | 14,801 B | 67,717 B | 21,489 B |
| 2x | 800 x 600 | 418,642 B | 32,537 B | 185,911 B | 50,525 B |
| 4x | 1600 x 1200 | 1,550,960 B | 73,706 B | 473,864 B | 124,003 B |
Each export took between 8 and 100 ms in these single runs. The PNG grew about 3.7 times from 1x to 2x in Chromium and about 2.7 times in WebKit, while the pixel count grew four times. That is a property of this gradient file and says little about yours.
Redrawn from the vectors, not enlarged
The tool changes the width and height in the SVG and lets the browser rasterize it at that size. To see whether that matters, we enlarged the 1x PNG to 4x on a canvas with high-quality smoothing and compared it with the direct 4x render. The PSNR between the two was 25.5 dB in Chromium and 27.5 dB in WebKit, with a mean difference of 1.8 and 1.4 levels per color channel. The two are not the same picture. PSNR is a rough measure.
What the renderer skipped, tested
We wrapped small test shapes in a red 100 x 100 square and read the center pixel after the tool's draw step. The results were the same in Chromium 153 and WebKit 26.6.
- A script inside the file that recolors the square: it did not run, the pixel stayed red.
- An image with a data: address: it showed. An image pointing at a file name next to the SVG: it did not load, and the red square stayed.
- A style rule with a class, inside the file: applied.
- Broken markup (an unclosed tag): the tool reports that the SVG could not be drawn.
- Canvas size: 16,384 x 16,384 and 20,000 x 12,000 were accepted, 16,385 x 16,384 and 20,000 x 20,000 were refused. For a 5000 x 5000 SVG at 4x the message read: the largest size at this shape is 16,384 x 16,384 px, use a scale of 3.2x or less.
SVG to PNG and JPEG questions
How does it read an SVG sized in mm, cm or inches?
It converts the unit to pixels at the CSS rate of 96 per inch, as a browser does. 200mm is 756 px, 10cm is 378 px, 1in is 96 px, 72pt is 96 px and 6pc is 96 px. Type a width of your own, or press 2x to 4x, if you need more pixels.
What size does it use when the SVG has no width and height?
It uses the viewBox size. If only one of the two is given, that side is kept and the other follows the viewBox proportions. If there is no viewBox either, a missing width becomes 300 and a missing height 150. Percentages count as not given.
Why does my text appear in a different font?
The SVG is drawn as an image, and images cannot load outside fonts or other files. Text in a font that is not on your computer falls back to a default. Convert text to outlines in your editor, or embed the font, before exporting.
What is the largest size I can export?
That depends on your browser, because the picture is drawn on a canvas first. In Google Chrome 158 a canvas of 16,384 x 16,384 pixels (268 megapixels) worked and one of 20,000 x 20,000 did not. Ask for too much and an error message gives the biggest width and height your browser allows at that shape.
Can I keep a transparent background in a JPEG?
No. JPEG has no transparency, so the tool paints white first. Choose PNG when you need transparency.
Does a custom size change the proportions?
Only if you switch the aspect lock off. With the lock on, typing one side recalculates the other from the SVG's own proportions.
Is a 4x export sharper than enlarging the 1x PNG?
In our test the two were not the same: a 1x export enlarged 4x on a canvas differed from the direct 4x render by a PSNR of 25.5 dB in Chromium 153 and 27.5 dB in WebKit 26.6. The tool redraws the vectors at the new size, so the browser draws the strokes and text at the new size instead of stretching a bitmap.
Will scripts or linked pictures in my SVG work?
In Chromium 153 and WebKit 26.6 a script did not run, a picture with a data: address showed, and a picture that pointed to a file name next to the SVG did not load. Embed pictures as data: addresses before converting.
Is JPEG export limited in size?
Yes, to 65,500 pixels wide or tall. A 65,510 x 100 JPEG export got a message naming that limit and no file in Chrome 158, Chromium 153, Firefox 155 and the WebKit build. Choose PNG or a smaller size. The canvas limit under What is the largest size I can export? applies to both formats.