Start with the complete printed square
To size a QR code SVG for print, choose the final outer width, including its white quiet zone. The QR Code Generator shows the dark-and-light matrix count and downloads an SVG with a four-module border on all four sides. If it reports 25 × 25 modules, the full file occupies 33 × 33 module units: 25 for the matrix plus 4 on the left and 4 on the right. A 30 mm outer square would give each module about 0.91 mm and each blank side about 3.64 mm. That is an example layout, not a universal minimum size.
DENSO WAVE, the QR Code developer, specifies a clear margin four modules wide around a standard QR Code. A border, caption, crop line or background pattern should stay outside that area. Count the existing white area in this site's SVG once; do not add a second four-module border unless you deliberately want more space.
Calculate width from the module count
The extra eight modules are four blank modules on each side of one dimension. Reversing the formula gives module width = chosen outer width ÷ (matrix modules + 8). Quiet-zone width on each side = 4 × module width. Use the same unit, such as millimetres, throughout.
The generator shows matrix modules, not the outer count. Its SVG's square viewBox includes the border. The width and height attributes inside the downloaded SVG are display pixels; they do not prescribe a millimetre size on paper. Set the physical width in your layout or print dialog and keep the aspect ratio at 1:1.
Worked example: a 30 mm SVG for a short URL
Enter the literal https://example.com in our generator. With its current Byte mode and level-M error correction, that 19-byte link produces a 25 × 25 matrix. The downloaded file already includes the four-module border, making the outer grid 33 × 33. Suppose the finished artwork assigns the entire SVG a 30 mm × 30 mm box.
| Measure | Result | Calculation |
|---|---|---|
| Outer grid | 33 modules across | 25 + 4 + 4 |
| One module | 0.909 mm | 30 mm ÷ 33 |
| Quiet zone, each side | 3.636 mm | 4 × 30 mm ÷ 33 |
| Matrix only | 22.727 mm | 25 × 30 mm ÷ 33 |
| Check the total | 30.000 mm | 22.727 + 3.636 + 3.636 |
The active matrix is only about 22.73 mm wide inside the 30 mm box. If a designer instead makes the matrix alone 30 mm, the entire SVG will be wider: 33 × (30 ÷ 25) = 39.6 mm. Specify whether a requested size means the whole square or only the patterned centre before sending artwork to print.
SVG, 300 DPI and raster pixels are different measurements
For a vector-capable print workflow, keep the SVG and set its output to 30 mm square. Its paths can be scaled without a fixed bitmap resolution. If a printer or design app requires PNG, calculate pixels from the outer physical width: pixels = width in mm ÷ 25.4 × DPI. At an illustrative 300 DPI, 30 ÷ 25.4 × 300 = 354.33, so round up to at least 355 × 355 pixels. The original SVG's on-screen pixel dimensions are not evidence that the final print is 300 DPI.
A whole-pixel module grid can also help preserve crisp square edges when rasterizing: 33 outer units × 11 pixels each = 363 × 363 pixels for this example, about 307 DPI across 30 mm. Use a rasterizer that keeps the modules sharp; avoid resampling a tiny bitmap upward. DENSO's own print-area example uses whole printer dots per module, but its arithmetic is not a guarantee that a particular phone will scan a small print.
A longer link changes the calculation
The same generator gives 33 × 33 matrix modules for https://calculationguide.com/writing/qr-code-generator under its current settings, so its outer grid is 41 × 41. At the same 30 mm width, one module becomes 30 ÷ 41 = 0.732 mm, and the quiet zone becomes 2.927 mm per side. The printed box did not change, but each square became smaller. Copy your actual matrix count from the result instead of assuming every URL produces the 25-module example. Shortening a link may reduce the count, but a third-party short link adds a dependency; check the destination and its longevity.
Print and scan the real artwork before a full run
- Generate the QR image from the final, checked text. Note the displayed matrix count and download its SVG.
- Set an explicit square physical size in the card, label, flyer or sign layout. Preserve the white border; keep text, artwork, folds and trim outside it.
- Export or print at actual size rather than judging a screen preview. Keep high contrast and avoid stretching the square or softening its edges.
- Scan a physical sample with the intended phone or scanner from the distance and angle people will actually use. Test on the real stock, especially if it is curved or glossy, and verify the destination opens correctly.
There is no single print width that guarantees scanning. Module count, print quality, surface, light, camera focus and viewing distance all matter. If the sample struggles, give the whole square more room, simplify the encoded text where possible and repeat the test. The QR Code Generator creates the artwork; it does not certify a print job or verify a URL's safety.
QR Code GeneratorGenerate your final SVG, read its matrix count in the result, and apply the width formula above to your actual layout.