True-scale graph paper PDFs

A single-file Python script with no dependencies that writes vector graph paper whose squares measure what they say when printed at 100%.

Download the examples

Make your own

python3 graphpaper.py --square 0.25in --paper letter --major 4 -o quarter-inch-letter.pdf
python3 graphpaper.py --square 5mm --paper a4 --major 2 -o 5mm-a4.pdf

Why printed grids come out the wrong size

  1. Fit to page. Print dialogs often shrink the page to the printable area, so a 1/4 in grid prints a few percent small. Choose 100% / Actual size. These PDFs also set /PrintScaling /None.
  2. Raster images. A PNG grid depends on its pixel density; vector lines in PDF points (72 pt = 1 in) do not.
  3. Clipped squares. The script fits a whole number of squares inside the margin and centres the grid.

Check a print with a ruler: ten 1/4 in squares should measure 2.5 in, ten 5 mm squares 50 mm.

Prefer the browser? Paper Generator makes true-scale graph and lined paper for Letter, A4 and Legal.