SVG px, mm, and pt Explained for Correct PDF Page Sizes
A unit conversion guide for SVG to PDF: CSS pixels, points, millimeters, viewBox coordinates, A4 dimensions, and page-size troubleshooting.
On this page
Advertisement
An SVG can use unitless coordinates, CSS pixels, points, millimeters, centimeters, or inches. A PDF page uses physical dimensions, normally expressed internally in points. Confusing those systems is why an SVG intended to be A4 sometimes exports as a tiny card or an oversized poster.
The key rule in SVG2IMG is:
1 CSS pixel is treated as 0.75 PDF point, based on 96 CSS pixels per inch and 72 PDF points per inch.
Physical SVG units such as mm, cm, in, and pt are converted through the same 96-DPI CSS reference.
The Unit Relationships
| Unit | Equivalent |
|---|---|
| 1 in | 96 CSS px |
| 1 in | 72 PDF pt |
| 1 px | 0.75 pt |
| 1 mm | about 3.7795 px |
| 1 pt | about 1.3333 px |
These conversions define page dimensions. They do not determine raster image quality by themselves. DPI matters only when SVG content is rendered into pixels.
Why 210 × 297 px Is Not A4
A4 is 210 × 297 millimeters. If an SVG says:
<svg width="210" height="297" viewBox="0 0 210 297">the unitless width and height are treated as pixels. At 96 px per inch, the PDF page is only about 55.6 × 78.6 mm.
For a physical A4 page, write:
<svg width="210mm" height="297mm" viewBox="0 0 210 297">The viewBox still provides a convenient 210-by-297 drawing coordinate system, while width and height specify the physical page.
You can also use pixels that correspond to A4 at 96 DPI, but the millimeter form is clearer when print size is the intent.
Width and Height Versus viewBox
These attributes answer different questions:
widthandheightdefine the viewport and, when physical units are present, the intended physical size.viewBoxdefines the internal coordinate system and visible region.
For example:
<svg width="100mm" height="50mm" viewBox="0 0 1000 500">The PDF page is 100 × 50 mm. The artwork is designed in a 1000 × 500 coordinate system and scaled to fit that page. One drawing unit is not one millimeter.
Changing only the viewBox can crop or zoom the artwork without changing the intended page dimensions. Changing only width and height changes the output page size.
Common Page Sizes
| Page | Millimeters | CSS pixels at 96 DPI | PDF points |
|---|---|---|---|
| A4 portrait | 210 × 297 | 793.70 × 1122.52 | 595.28 × 841.89 |
| A4 landscape | 297 × 210 | 1122.52 × 793.70 | 841.89 × 595.28 |
| US Letter | 215.9 × 279.4 | 816 × 1056 | 612 × 792 |
| A5 portrait | 148 × 210 | 559.37 × 793.70 | 419.53 × 595.28 |
Small decimal differences are normal. PDF viewers may round the displayed dimensions.
Custom Pixel Dimensions
If you enter 800 × 600 px, the PDF page becomes 600 × 450 pt, or about 211.7 × 158.8 mm. This is useful when the SVG comes from a screen-design workflow and the exact pixel-based aspect ratio matters. It is less convenient when a printer expects A4, Letter, or another physical standard.
For print, prefer source SVG dimensions in mm, cm, in, or pt, then choose original size during conversion.
Page Size Is Not Print Resolution
A vector PDF has no single DPI for its paths. Curves and shapes are recalculated by the printer at output resolution. Embedded bitmap images keep their own pixel dimensions.
An image PDF does have an effective DPI:
effective DPI = image pixels / page width in inchesAn A4 page is 8.27 inches wide. A raster 2480 pixels wide is about 300 DPI. A raster 1240 pixels wide is about 150 DPI.
SVG2IMG targets 300 DPI for image PDF fallback, while limiting the longest raster dimension to 4096 pixels to control browser memory. Very large physical pages can therefore fall below 300 DPI.
Troubleshoot an Unexpected PDF Size
- Inspect the root
<svg>width,height, andviewBox. - Look for omitted units:
210means pixels, not millimeters. - Check whether a design tool exported only the selected artwork instead of the artboard.
- Use original size if the SVG already has physical units.
- Use custom dimensions only when you intentionally want a pixel-defined page.
- Verify the PDF document properties, not just the zoom percentage in the viewer.
A PDF viewer's “Fit page” mode can make different page sizes look identical on screen. Open document properties or enable rulers to confirm the physical dimensions.
Before Sending to Print
Correct page size is only one part of print preparation. Also confirm bleed and trim requirements, safe margins, color profile expectations, font outlining, PDF/X requirements, and the effective DPI of raster effects.
Use the SVG to PDF converter with original size to preserve physical SVG units. If your source is designed in pixels, calculate the target physical dimensions before choosing a custom page size.
Put the guide into practice
Convert SVG files locally in your browser without uploading them.
Open converter