Label-sheet geometry
The bulk label tool does two jobs: it validates every row with the same arithmetic as the single-barcode generators, and it places each accepted barcode at an exact position on a sheet. This guide is about the second job. Everything the placement code knows is a handful of millimetre values — a page, a label size, a grid, two margins, two gaps — and everything it does is addition and multiplication over them. Every figure below is computed at build time by the engine that places your labels, so this page cannot disagree with the tool. The check-digit arithmetic each row passes first has its own guide, how GTIN check digits are computed; the series is on the guides page.
Two pages, one unit
The engine works in millimetres and knows two pages. Letter is defined in inches and converted exactly: 215.9 × 279.4 mm (8.5 × 11 in). A4 is defined in millimetres directly: 210 × 297 mm. Each preset is therefore transcribed in the unit of its published specification, and the two never mix where positions are calculated.
What a template is
A template is nine facts and a flag: the page, the label width and height, the columns and rows, the top margin, the left margin, the horizontal gap and the vertical gap. The top margin runs from the page's top edge to the first row of labels, the left margin from the left edge to the first column; the gaps are the spaces between adjacent labels. The flag says whether the template is a preset or a grid you typed in, and has one effect: custom grids are the only mode that prints cut guides.
Presets: the arithmetic must close
The three presets are Avery geometries taken from the manufacturer's published template specifications (5160, 5163, L7651). The engine does not trust the transcription: a unit test asserts that twice the side margin, plus the labels, plus the gaps between them, reproduce the page width exactly — likewise the height — or the test fails. This page repeats that check when it is built, so the table below could not render if a preset had drifted.
| Template | Page | Label | Grid | Per sheet | Pitch (x / y) | Width closes | Height closes |
|---|---|---|---|---|---|---|---|
| Avery 5160 | Letter | 2.625 × 1 in | 3 × 10 | 30 | 2.75 / 1 in | 2 × 0.1875 + 3 × 2.625 + 2 × 0.125 = 8.5 in | 2 × 0.5 + 10 × 1 + 9 × 0 = 11 in |
| Avery 5163 | Letter | 4 × 2 in | 2 × 5 | 10 | 4.1875 / 2 in | 2 × 0.15625 + 2 × 4 + 1 × 0.1875 = 8.5 in | 2 × 0.5 + 5 × 2 + 4 × 0 = 11 in |
| Avery L7651 | A4 | 38.1 × 21.2 mm | 5 × 13 | 65 | 40.6 / 21.2 mm | 2 × 4.75 + 5 × 38.1 + 4 × 2.5 = 210 mm | 2 × 10.7 + 13 × 21.2 + 12 × 0 = 297 mm |
Letter presets are shown in inches and the A4 preset in millimetres because that is how the engine defines them, so the sums close without rounding. For Avery 5163 the published template prints rounded decimals for its side margin and column gap; the engine uses the exact fractions that close the page, and its header says so. No preset has a vertical gap.
Where each label lands
Positions are generated row-major — left to right along the first row, then the next row down — each carrying a zero-based index, its column and row, and the top-left corner of its cell. Two formulas are the whole of it: x is the left margin plus the column number times the horizontal pitch (label width plus gap); y is the top margin plus the row number times the vertical pitch (label height plus gap).
Worked example — Avery 5160, horizontal pitch 69.85 mm, vertical pitch 25.4 mm:
Index 0 (column 0, row 0) sits at x = 4.76 mm, y = 12.7 mm — the two margins.
Index 3 (column 0, row 1) opens the second row: x = 4.76 mm, y = 38.1 mm.
Index 29 (column 2, row 9) sits at x = 144.46 mm, y = 241.3 mm, leaving 4.76 mm to the right page edge and 12.7 mm to the bottom — the same margins the sheet started with.
Engine output at build time, rounded to two decimals for display.
How many sheets
Labels per sheet is columns times rows. Sheets needed is the label count divided by that figure, rounded up — and 0 for zero labels, so an empty list never produces an empty page. A label's sheet is its index divided by the per-sheet count, rounded down; its cell is the remainder.
Worked example — a fictional order of 95 labels on each preset:
Avery 5160: 30 per sheet → 4 sheets, 5 labels on the last one.
Avery 5163: 10 per sheet → 10 sheets, 5 labels on the last one.
Avery L7651: 65 per sheet → 2 sheets, 30 labels on the last one.
On Avery 5160 (30 per sheet), the 31st label (index 30) lands on sheet 2 at cell index 0 — back in the top-left corner; the 48th (index 47) lands on sheet 2, cell index 17, column 2, row 5.
The index counts labels that print — the tool page states that only valid rows do. At the input cap of 300 lines the presets need 10 (Avery 5160), 30 (Avery 5163), 5 (Avery L7651) sheets.
Custom grids: checked, never clamped
A custom grid takes the same nine facts in millimetres and validates them in a fixed order. Each value must be a finite, non-negative number; columns and rows must be whole numbers, at least one of each, within the tool's per-sheet caps; the label must not be below the engine's minimum size; margins and gaps above its sanity limits are refused as probable typos. Only then does the fit check run: left margin plus columns of labels plus the gaps between them must fit the page width, within a tiny floating-point tolerance, and top margin plus rows the page height. Nothing is clamped: in the engine's own words, out-of-range or non-fitting values are reported with the numbers involved so the person can fix their measurement.
Worked example — a fictional A4 grid: labels 50 × 25 mm, 3 columns by 9 rows, top margin 16 mm, left margin 12 mm, gaps 6 mm across and 3.5 mm down:
Accepted as “Custom — A4, 50 × 25 mm, 27 per sheet” — 27 per sheet, so the 95-label order needs 4 sheets.
Used width 174 mm of 210, leaving 36 mm on the right; used height 269 mm of 297, leaving 28 mm at the bottom. The last cell (index 26) sits at x = 124 mm, y = 244 mm.
Note what the fit check did not ask: whether the grid is centred. The right-hand remainder exceeds the left margin and the engine accepts that, because it is what was measured. Change one value and the same grid is refused, in the engine's words:
- Rows entered as 2.5: “Columns and rows must be whole numbers.”
- Columns raised to 13: “This tool caps custom grids at 12 columns × 30 rows per sheet.”
- Columns raised to 4: “The grid is 230.0 mm wide but the page is only 210.0 mm — reduce columns, label width, gap, or margin.”
The last message names both the width the grid would need and the width the page has, so the fix — fewer columns, a narrower label, a smaller gap or margin — is chosen against the real sheet rather than by trial.
Inside the cell
Placement decides the cell; a second small function fits the rendered symbol into it with the aspect ratio preserved, centred, never stretched. The canvas it fits is sized against a constant the engine calls TARGET_DPI, whose value is 300 — a rendering target for the image the PDF embeds, not a statement about your printer. This site publishes no size or resolution tables beyond the figures cited on the methodology page.
Caps, and what the report says
The tool keeps at most 300 non-blank lines per pass and caps a local file import at 1 MB before the file is read. Neither cap is silent: the parser counts every non-blank line it saw, including those beyond the cap, and reports the truncation; larger files go in batches. Rows that fail validation are listed with their line number and the reason; the summary states how many passed and how many failed.
What geometry cannot tell you
Exact placement is a property of arithmetic, as is everything validation checks first: length, character set, check digit. Two things sit outside both. First, the methodology page is explicit that bulk PDF label sheets are the deliberate exception to the independent decode the interactive generator performs: each row is validated before rendering, but the assembled PDF rows are not individually decoded. What that decode checks and withholds is the subject of how the verifier decodes what you see. Second, no browser check can certify what happens after printing, which is why the tool page asks you to print at 100% scale, test one sheet on plain paper against the stock, and scan a printed label with your own scanner. And a row that validates is structurally valid; whether its number is licensed is a separate question — see do I need a GS1 barcode?
Label-sheet geometry FAQ
Why does the tool refuse my custom grid instead of shrinking it to fit?
Because a clamped grid would print labels where you did not measure. The engine never silently adjusts a value: a non-fitting or out-of-range grid is reported with the numbers involved, and an accepted grid is placed exactly as entered.
Which rows end up on the sheet?
Only rows that pass validation. The tool lists each failed row with its line number and the reason, and the summary states how many passed and how many failed. Placement counts the labels that print, in order, from the first cell of the first sheet.
Why do custom sheets get cut guides but the Avery presets do not?
The presets describe die-cut stock, so a guide drawn at a label edge would print on the labels. A custom grid describes stock the tool knows nothing about, so a hairline around each cell shows where the cuts fall. The custom flag is the only switch.
Why does the custom form ask for the left and top margins but never the right or bottom?
Placement only needs to know where the first column and first row begin; every other position follows from the label size and gaps. The fit check asks whether left margin plus grid fits the page width and top margin plus grid the page height; whatever remains is unused, so a custom grid may sit off-centre if that is what you measured.
If the sheet lines up perfectly, will the barcodes scan?
Geometry decides where each symbol is placed, not whether it reads. Every row is validated for length, character set and check digit before rendering, but bulk PDF sheets are the deliberate exception to the independent decode: the assembled rows are not individually decoded. Print at 100% scale and scan a printed label with your own scanner before production.
Math, not optics: this guide describes where the engine places each label and the arithmetic it verifies first. Whether a printed symbol scans depends on contrast, size, substrate and preserved quiet zones, which no browser can check — test a printed sheet with your own scanner before production. See the methodology page for the boundary between the verification layer and the renderer.