Add a QR code to a PDF
Adding a QR code to a PDF stamps a scannable square onto its pages, so anyone holding the printed document can reach a live URL — a payment page, a current price list, a sign-up form — by pointing a phone at the paper. This page generates the code from any link or text at error-correction level M, then stamps it at the corner, size, and pages you choose, entirely in your browser. Print a test page and scan it before a large run, and keep the printed code at least about 2 cm on a side.
How it works
A QR code is a grid of black and white squares — modules — that encodes your text in binary, wrapped in Reed-Solomon error-correction data. The generator first picks the smallest QR version (grid size) that fits your content: a 30-character URL fits in a version 2 code, a 25-by-25 module grid, while longer text steps up through larger versions. This tool fixes the error-correction level at M, meaning roughly 15 percent of the modules can be smudged, torn, or misprinted and the code still decodes — the standard trade-off between robustness and density, and the reason a level-M code survives a mediocre office printer and a later photocopy.
The encoder also applies one of eight mask patterns, chosen by scoring rules from the QR specification, to break up large same-color areas that would confuse a scanner's timing. Around the finished grid sits the quiet zone — a mandatory border of clear space at least four modules wide that lets a scanner find the code's edges; the stamp this tool draws includes that white border, which is why you should not butt the code directly against dark page content.
Stamping is then straightforward geometry. The generated code is drawn into the PDF at the corner you chose, inset from the page edges, at your chosen physical size, on every selected page — the same mechanism as a watermark stamp, appended to each page's content stream on top of the existing content. Body text stays fully selectable; nothing is rasterized except the code image itself, and file-size growth is a few kilobytes total because the same code object is reused across pages.
Two practical rules decide whether the printed code actually scans. Size: at typical 300 dpi office printing, a 2 cm code gives each module of a version 2 grid about 9 printed dots, comfortably above the readability floor — smaller than that, or with a long URL forcing a denser grid, and scanning gets flaky. Testing: print one page and scan it with a real phone before committing to a run, because screen previews scan more easily than paper. If you only need the code image itself, without stamping it into a document, use the standalone Generate QR code tool.
Illustrative example: 300 printed event programs
Illustrative scenario, not a recorded benchmark. File sizes, timings and results depend on the input and device. Try the reproducible samples.
A conference team has a 4-page program PDF (1.1 MB) going to print in 300 copies, and the schedule always changes after printing. They put the schedule at a short URL they control and stamp it into the PDF with this tool: content https://ex.co/sched (19 characters, fitting a compact version 1–2 code), bottom-right corner, 22 mm, pages 1 and 4 only, so the code appears on the front and back covers but not over the interior layout.
Generation and stamping take under a second; the output file is 1.1 MB, about 4 KB larger than the input. They print one test copy: an iPhone and an Android phone both lock onto the 22 mm code from about 40 cm away in under a second, including on a deliberately made photocopy of the test page — the level-M redundancy absorbing the copy's degradation. The 300 programs go to print, and when a speaker cancels two days later, the team edits the short link's destination; every printed code now points to the corrected schedule without a single reprint.
Frequently asked questions
How do I add a QR code to a PDF?
Generate the code from your link or text, then stamp the resulting image onto the pages at a fixed corner and size. This page does both steps in your browser: type the content, pick the corner, size, and pages, and download the stamped file — nothing is uploaded.
How big should a QR code be to scan reliably from print?
Plan on a minimum of about 2 centimeters on a side for a short URL scanned at arm's length, and larger if the content is long or the document may be photocopied. Always print one test page and scan it with a phone before running the full batch.
What does error-correction level M mean?
QR codes carry redundant data so damaged or dirty codes still scan; level M, which this tool uses, allows roughly 15 percent of the modules to be unreadable before the code fails. It is the standard middle setting — more robust than level L without inflating the module count the way levels Q and H do.
Can I put the QR code on only the first page?
Yes — you choose the pages that get stamped, so a cover-only code, a code on every page, or a specific range all work. Unselected pages pass through unchanged.
Should the QR code hold the URL itself or something else?
A short, stable URL is best: fewer characters means fewer modules, which scans more reliably at small print sizes. If the destination might change after printing, encode a short link you control so you can redirect it later without reprinting.
Will the stamped code cover up my document's content?
The code is drawn on top of the page at the corner you choose, so place it in a margin or a whitespace corner to avoid overlapping text. A quiet zone of clear space around the code is part of the spec — the stamp includes a white border so scanners can find the edges.