Menu

Search toolsChangelog

to move to openDescribe the problem, not the tool

Printable graph paper, worked out to the millimetre

Works out how a grid of squares actually falls on a sheet of paper: how many squares fit across and down, where the first line sits measured from the paper edge, how long every line is end to end, and how much of the sheet is ink. Everything is computed in this browser tab.

Sizes as the CSS Paged Media specification defines them. An inch is exactly 25.4 mm.

The side of one square. 5 mm is school graph paper; 6.35 mm is a quarter of an inch.

How thick a fine line is drawn. Under about 0.1 mm most inkjets render it unevenly.

Blank border on all four sides. Most desktop printers cannot print within about 5 mm of the edge.

Zero draws a plain grid with no heavy lines at all.

Squares on the sheet
2,090
Whole squares only. A partial square at the edge is not drawn.
Squares across
38
Squares down
55
Grid width (mm)
190.00
Grid height (mm)
275.00
First line from the left edge (mm)
10.00
First line from the top edge (mm)
11.00
Lines drawn
95
Of those, heavy
20
Total line length (m)
21.365
Page covered by ink
10.039%

The sheet

graph-paper-a4-5mm.svg · 1.4 KB

Vector, dimensioned in millimetres, so it prints at true scale on any printer. Print it from here to skip the page furniture, or save it and open it in anything.

Every line on the sheet

Vertical0100.5Heavy
Vertical1150.25Fine
Vertical2200.25Fine
Vertical3250.25Fine
Vertical4300.25Fine
Vertical5350.5Heavy
Vertical6400.25Fine
Vertical7450.25Fine
Vertical8500.25Fine
Vertical9550.25Fine
Vertical10600.5Heavy
Vertical11650.25Fine

How it works

What this works out

Graph paper looks like it should divide evenly and it usually does not. A4 is 210 mm across, which 5 mm squares divide exactly 42 times, and 297 mm down, which they do not divide at all. So every sheet has a leftover strip, and where that strip ends up decides whether the printed grid looks deliberate or looks like it slipped.

This works out the whole layout before any of it reaches a printer: how many whole squares fit, how wide and tall the grid really is, and — the number worth checking with a ruler — how far the first line sits from the edge of the paper rather than from the margin you typed.

The method

The printable area is the sheet less twice the margin, and the number of squares is that area divided by the square size, rounded down. Everything else follows from those two numbers.

The one genuinely delicate part is the rounding down. Divide 198 mm by 4.4 mm in ordinary binary floating point and the answer is 44.99999999999999, so rounding down gives 44 columns where there are plainly 45. That is not a display glitch: the missing column changes the grid width by 4.4 mm and moves every line on the sheet.

How often it bites has two halves, and both are worth stating. Step the square size with the arrows on the control and you never meet it: across all six papers, both orientations, every half-millimetre size from 1 to 50 mm and every whole-millimetre margin from 0 to 50 — 60,588 combinations — binary floating point gets every single one right. Type a size the arrows do not land on, which the box accepts, and that stops holding. Widen the same enumeration to every square size that is a whole tenth of a millimetre, and 512 of the 300,492 combinations come out wrong, each by exactly one square; 4.4 mm inside a 6 mm margin is one of them. Both counts are enumerated in this tool’s test file rather than only stated here, so neither can quietly stop being true.

So every length here is held as a whole number of micrometres — a thousandth of a millimetre, four orders of magnitude finer than any printer resolves — and the division is integer division, which cannot be nearly right.

The leftover strip is the other choice worth explaining. Centred is the default because a grid pushed into one corner reads as a mistake, but centring means the margin you get is not always the margin you asked for: the tool reports the distance from the paper edge to the first line, which is the figure a ruler measures.

Ink coverage is the union of the strokes, not the sum of them. Every vertical line crosses every horizontal one, and those crossings are drawn twice by a naive sum, so they are subtracted once. On the default A4 sheet the crossings come to 199.75 mm², about three per cent of the ink, which is more than a rounding detail if you are estimating cartridge life across a ream.

Before you read on

A printable strip 198 mm across, ruled in 4.4 mm squares. How many whole columns does a straightforward floating-point calculation report?

  • 45 is right. It is not what the arithmetic returns.

  • Yes. 198 / 4.4 evaluates to 44.99999999999999, and rounding that down loses a column.

  • Rounding to nearest would give the right answer here and the wrong one everywhere a square genuinely does not fit.

44, one short. 198 / 4.4 in binary floating point is 44.99999999999999, and rounding down loses a column that is plainly there. That is not a display glitch — the missing column changes the grid width by 4.4 mm and moves every line on the sheet. It is also not rare enough to ignore: step the size with the arrows and all 60,588 combinations of paper, orientation, half-millimetre size and whole-millimetre margin come out right, but type a size the arrows do not land on and 512 of 300,492 go wrong, each by exactly one square. So every length here is a whole number of micrometres and the division is integer division, which cannot be nearly right.

A worked example

A4, portrait, 5 mm squares, 0.25 mm fine lines, a heavy 0.5 mm line every fifth square, a 10 mm margin, grid centred:

printable area   190.00 x 277.00 mm
squares          38 across, 55 down          = 2,090
grid             190.00 x 275.00 mm
first line       10.00 mm from the left edge
                 11.00 mm from the top edge
lines drawn      95, of which 20 are heavy
line length      21.365 m
ink coverage     10.039% of the sheet

The width is exact: 190 mm is 38 squares of 5 mm with nothing over, so the left margin stays at the 10 mm asked for. The height is not: 277 mm holds 55 squares and 2 mm is spare, split between the top and the bottom, which is why the first horizontal line sits at 11 mm.

Checking the two derived figures by hand:

FigureArithmeticResult
Line length39 verticals × 275 mm + 56 horizontals × 190 mm21,365 mm
Ink area11.75 × 275 + 17 × 190 − 11.75 × 17 mm²6,261.5 mm²
Coverage6,261.5 ÷ (210 × 297)10.039%

These are the same numbers asserted in this tool’s test file, so if the formula ever changes without this page changing with it, the build fails.

Quarter-inch squares on US Letter are the tidy counter-example. Take a half-inch margin off each side of an 8.5 by 11 inch sheet and 7.5 by 10 inches remain, which quarter-inch squares divide exactly 30 and 40 times. Nothing is left over, so the centred and top-left layouts produce an identical sheet. It is not the only such case: over the 60,588 combinations above, 570 divide exactly in both directions and so ignore the alignment setting altogether, the first being 1 mm squares on A4 with no margin. The test file counts them too.

What it does not do

It does not draw the sheet. It gives you the geometry and the full line list, which downloads as a CSV of every line’s axis, position from the paper edge, weight and kind — enough to reproduce the grid exactly in a drawing program, a plotter file or a stylesheet, but not a ready-made page to send to a printer.

It also knows nothing about your printer. The paper sizes are trimmed sizes, so the hardware border that a desktop printer physically cannot reach is not deducted, and neither is the scaling a print dialogue applies by default. Both of those are settings on the far side of this page, and both will quietly make the printed sheet disagree with every figure above if they are left alone.

The same geometry applied to months rather than to a grid is a printable calendar — the same trimmed paper sizes, and the same caveat about what your printer will do to them.

The formula

printableWidth  = pageWidth  - 2 x margin
printableHeight = pageHeight - 2 x margin

across = floor(printableWidth  / spacing)
down   = floor(printableHeight / spacing)

gridWidth  = across x spacing
gridHeight = down   x spacing

centred:   firstLineX = margin + (printableWidth  - gridWidth ) / 2
           firstLineY = margin + (printableHeight - gridHeight) / 2
top-left:  firstLineX = firstLineY = margin

verticalLines   = across + 1
horizontalLines = down   + 1

a line is heavy when  every > 0  and  index mod every = 0
heavyVertical = floor(across / every) + 1

lineLength = verticalLines x gridHeight + horizontalLines x gridWidth

Wv = total width  of the vertical   strokes, capped at gridWidth
Wh = total height of the horizontal strokes, capped at gridHeight

inkArea  = Wv x gridHeight + Wh x gridWidth - Wv x Wh
coverage = inkArea / (pageWidth x pageHeight)

Every length above is held as a whole number of micrometres.

What it assumes

  • Every length is held as a whole number of micrometres, a thousandth of a millimetre, because the answer turns on a floor division and a floating-point millimetre gets that wrong by an entire column. On A4 with a 6 mm margin and 4.4 mm squares, 198 divided by 4.4 evaluates to 44.99999999999999, so a naive implementation reports 44 squares where there are 45.
  • Only whole squares are counted. A partial square in the leftover strip is not drawn and not included, because a grid that ends in a sliver is what makes printed graph paper look wrong.
  • Ink coverage treats each stroke as centred on its line and entirely on the paper. At a zero margin the outermost line loses half its width over the edge, so the figure is a fraction of a per cent high there.
  • Paper sizes are trimmed sizes. Your printer's own hardware margin, usually 4 to 6 mm, is not deducted, so a margin below about 5 mm may be clipped by the printer rather than by the page.
  • Every millimetre here assumes the sheet is printed at 100%. Browsers and print dialogues default to fitting the page, which shrinks everything by two or three per cent and makes 5 mm squares measure 4.9.

Common questions

How many 5 mm squares fit on a sheet of A4?

With a 10 mm margin all round, 38 across and 55 down, which is 2,090 squares. With no margin at all it is 42 by 59, or 2,478. The width divides exactly either way, because 210 mm is 42 whole squares; the height never does, because 297 is not a multiple of 5.

Why is my top margin 11 mm when I asked for 10?

Because a whole number of squares almost never fills the page exactly, and the leftover has to go somewhere. A4 gives 277 mm of printable height at a 10 mm margin, and 55 squares of 5 mm is 275 mm. Centring splits the spare 2 mm between the top and the bottom, so both become 11 mm. Choose the top-left layout under "More options" if you would rather keep the margin you asked for and put the whole remainder at the bottom.

Why does my printed sheet measure slightly small?

Almost always because it was scaled. Print dialogues default to fitting the page to the printable area, which shrinks everything by two or three per cent — enough to turn 5 mm squares into 4.9 mm. Set the scale to 100%, or "Actual size", and turn off "fit to page". A ruler laid along ten squares is the quickest check: 5 mm squares should measure 50 mm.

Is anything uploaded?

No. The arithmetic runs in this browser tab and there is no server to send it to. The figures and the line list never leave the machine you are reading this on.

What is the smallest margin worth setting?

About 5 mm on a desktop printer. Almost none of them can print to the edge of the sheet: there is a hardware border, typically 4 to 6 mm and often larger at the trailing edge, that the paper feed simply cannot reach. Ask for less than that and the outermost lines are cropped by the printer rather than by anything on this page.

Sources