Add Margins to PDF Online — set custom top, bottom, left, and right margins
Set top, bottom, left, and right margins in millimeters, inches, or pixels — expand the page to add room, or scale content down to fit within it.
Add margins to your PDF
Upload a PDF, set your margins, choose how they are applied, and download the result.
Drop your PDF here
or browse files
Margins are just numbers around a page
A PDF page has defined dimensions that determine the space available for its content. This tool adds space around that content or scales it to fit within the existing page.
Two ways to make room
A printer that needs gutter space, a binder that trims a chunk off the inside edge of every page, a reviewer who wants blank space to write comments in — each of these needs extra room around a document's content, but for different reasons and in different amounts.
pdf-lib reads each page's current dimensions, then either draws a larger page and places the original content inside it at an offset (Expand), or scales the content down and repositions it within the existing page boundary (Keep Size). Units convert to points internally — 1mm = 2.835 points, 1 inch = 72 points — so the same margin looks identical regardless of which unit you typed it in.
Every control and what it changes
Four independent sides
Set top, bottom, left, and right separately — a document rarely needs the same margin on every edge.
mm, inch, or px
Choose the unit that matches your document specifications — the tool converts internally.
Mirror margins
Automatically swaps left/right on alternating pages, so binding margins line up correctly through a printed booklet.
Page range
Apply the same margin to every page, or only to a specific range you type in.
Expand vs. Keep Size
Grow the page to fit new margins, or scale the content to fit inside the current page.
Step-by-step margin configuration
Choose the unit first, then enter the margin values for each side.
Upload your PDF
Drag it onto the upload area, or click Select PDF. Thumbnails of every page load right away.
Set margin size and mode
Configure the four sides and how they're applied:
Apply
Click Add Margins. Every selected page is rebuilt with the new spacing in this tab.
Check and download
Page through the result to confirm the spacing looks right, then download.
From tight pages to properly spaced
A document with content running right to the edge, expanded with even margins on all sides.
Content reaches the page edge, leaving little room for printer margins, binding, or handwritten notes.
Even white space on every side — useful for printing, binding, or adding handwritten notes.
Two modes, two different outcomes
Same margin values, two very different results — pick based on whether page size matters.
Expand page size
Adds the margin as new white space around your existing content — the page gets physically larger. A US Letter page with 20mm margins added becomes larger than Letter. Right for printing, binding, or anywhere the original content size must stay untouched.
Keep page size
Scales your content down proportionally so it fits inside the same page dimensions, with the margin as empty border. Right when a form or template requires an exact page size (like A4 or Letter) that can't change.
Mirror margins
Swaps left and right margins on alternating pages, so the "inside" edge (the one lost to binding) gets the wider margin on every page — the standard setup for a printed book or booklet.
Page range
Applies the margin change to every page, or only to a range you specify — useful when only a section of a larger document needs different spacing.
Documents that need room around the content
Cases where extra space at the edges solves a real printing, binding, or reading problem.
| Situation | What margins solve | Typical user |
|---|---|---|
| Home & office printing | Add safe margins so a printer with limited edge coverage doesn't clip content. | Offices & students |
| Book & booklet binding | Use Mirror Margins to leave gutter room on the inside edge for stapling or perfect binding. | Publishers & print shops |
| Peer review & annotation | Add blank space around content for handwritten comments or stamps. | Editors & reviewers |
| Academic formatting | Meet a university or journal's required margin specifications before submission. | Students & researchers |
| Legal filings | Adjust document margins to meet a specified filing requirement; verify the applicable rules before submission. | Lawyers & paralegals |
| Scanned document cleanup | Standardize inconsistent margins across pages scanned from different sources. | Archivists & admins |
| Presentation handouts | Add note-taking space around slide content for printed handouts. | Presenters & trainers |
| Design proofing | Add extra safe space around page content before sending a document to print. | Designers |
When the margins don't come out right
Common margin problems, why they happen, and how to fix them.
Margins look much bigger or smaller than expected
The unit dropdown was left on the wrong setting — 20 inches is very different from 20mm.
Double-check the unit selector matches the numbers you typed, then re-run.
Content looks too small after adding margins
Keep Page Size mode was used with large margin values, shrinking the content a lot to fit.
Switch to Expand Page Size if the original content size matters, or reduce the margin values.
Output page size is now non-standard
Expand Page Size grows the page beyond a standard size like A4 or Letter.
Expected behavior — use Keep Page Size instead if the exact dimensions must stay standard.
Binding margin is on the wrong side of some pages
Mirror Margins wasn't enabled, so left and right stayed fixed instead of alternating.
Turn on the Mirror Margins checkbox before applying, then re-run.
Only some pages got the new margins
Page Range was selected but the typed range didn't cover the pages you meant.
Check the page range field, or switch to All Pages to apply it everywhere.
A password-protected PDF won't load
Encrypted files can't be read by the in-browser rendering engine.
Remove the PDF password first with our PDF Unlock tool, then upload the unlocked copy.
Margins look wrong size
Why: Wrong unit selected.
Fix: Check the unit dropdown, re-run.
Content too small
Why: Keep Page Size with large margins.
Fix: Use Expand Page Size instead.
Non-standard output size
Why: Expand mode grows the page.
Fix: Use Keep Page Size instead.
Wrong-side binding margin
Why: Mirror Margins was off.
Fix: Turn it on, re-run.
Only some pages changed
Why: Page range didn't cover them.
Fix: Check the range or use All Pages.
Password-protected PDF won't load
Why: Encrypted files can't decode in-browser.
Fix: Unlock it first, then upload.
Getting margins right on the first pass
A working order that avoids the most common redo.
Confirm the unit before typing numbers
Set mm, inch, or px first — it's the setting most likely to produce a wildly wrong result if overlooked.
Choose the mode based on what must stay fixed
Use Expand when you want to preserve the original content size. Use Keep Size when the final page dimensions must remain unchanged, such as A4 or Letter.
Turn on Mirror Margins for booklets
Documents with an inside binding edge may need alternating margins — enable this when the wider margin should move between left and right pages.
Try a preset first
Narrow, Normal, Wide, and Binding presets cover most common cases — start there before entering custom values.
Preview one page before processing all
Check the output preview carefully on the first result — it's much faster to adjust settings and re-run than to redo downstream work.
Keep the original file
Margin changes create a new document — keep the source PDF so you can try different values later.
Frequently asked questions
Clear answers to common questions about page margins and formatting.
Is my PDF uploaded to an external server?
No. All PDF processing takes place entirely within your browser using client-side JavaScript. Your file data is not sent to an external server.
What is the difference between Expand Page Size and Keep Page Size?
Expand Page Size increases the physical dimensions of the page by adding empty margins around the existing content. Keep Page Size maintains the original page dimensions by scaling down the content proportionally to fit within your specified margins.
Can I apply different margins to specific pages?
Yes. You can select Page Range and enter specific pages (e.g., 1-5, 8, 10-12) to apply margins only to selected parts of the document.
What happens if the margin values are too large?
In Keep Page Size mode, entering margins that exceed the width or height of the page will trigger an alert asking you to lower the values, preventing invalid blank or broken pages.
Does this tool work on mobile devices and tablets?
Yes. The tool runs in any modern browser on desktop computers, tablets, and mobile devices.
How this PDF margin tool was built
Because unit conversion, the expand/scale math, and mirroring all run client-side, I wrote up the implementation — how pdf-lib repositions embedded pages, and the arithmetic behind Mirror Margins.
How to Build a Browser-Based PDF Margin Tool Using JavaScript
Covers page-dimension math, unit conversion between mm/inch/px, and client-side PDF manipulation with pdf-lib.
Related PDF tools
Prepare, adjust layout, and optimize your document for any workflow.
Resize PDF
Standardize dimensions to A4, Letter, or custom canvas dimensions.
Crop PDF
Trim margins, remove headers/footers, or crop to a specific content area.
Rotate PDF
Rotate portrait or landscape pages permanently in 90-degree increments.
Compress PDF
Reduce file footprint for seamless email sharing and compact archiving.