Auto-Crop PDF Margins
Find the ink on each page and crop to it. Each page is rendered, scanned for the outermost pixels that are not white, and given a crop box around them with a little padding. Page content is untouched, so the crop is reversible. Runs in your browser.
Drop PDF files here or click to select
One or many · a cropped copy per file
Try sample-scanned.pdf. At the default tolerance of 8 it barely moves; at 30 the A4 pages crop to 495 by 756 points. More free sample files.
How the content box is found
Each page is rendered onto a white canvas at the detection DPI, 72 by default, 36 to 200 allowed. A pixel counts as content when any of its red, green or blue values is below 255 minus the tolerance; at the default of 8 that is anything darker than 247. The outermost content pixels on each side define the box, which is converted back to PDF points, widened by the padding and written as the page's crop box. A page with no content pixels is left uncropped and counted as blank in the status line.
Because it works on rendered pixels, it treats scans, vector drawings and text alike. Anything that renders counts, including page numbers, headers, scanner shadows and the grey cast of a poor scan.
Per page or one common box
Per page gives each page its own tightest box, so pages come out in different sizes and the text block shifts as you read. One common box takes the smallest margin found on each side across all pages, which is the union of the content, and applies it to every page. Pages keep one size and sparse pages keep some margin. For a document you will read straight through, the common box is the calmer result.
Tolerance, padding and DPI
- White tolerance, default 8. Scans are rarely pure white: on
sample-scanned.pdfthe default reports "Cropped 3 page(s)" but leaves the pages at their full 595 by 842 points, because the paper tint counts as content. At 30 the same pages crop to 495 by 756. Raise it until the crop bites, and stop before faint content is treated as background. - Padding, default 6 points, 0 to 72, is kept around the content so anti-aliased edges and descenders are not clipped. It cannot push the box beyond the page.
- Detection DPI, default 72. Higher settings catch hairlines and faint marks at the cost of time. The crop box is written in points, so the DPI does not affect output quality.
How to auto-crop the white margins of a PDF
- Drop the PDF with the oversized margins, or several; each gets its own cropped copy.
- Choose per page or one common box. Common box keeps every page the same size.
- Set the white tolerance. Leave 8 for clean digital pages; raise it for scans with a grey or cream background.
- Click Auto-crop. The status line reports how many pages were cropped and how many blank pages were left alone.
- Download
name-autocropped.pdfand check a page. Text stays selectable because only the crop box changed.
FAQ
Why did it barely crop my scan?
The background is not white enough to pass the tolerance. Raise the white tolerance and run again; on the scanned sample, 8 does nothing visible and 30 removes the margins.
Why do the pages have different sizes now?
Per-page mode fits each page to its own content. Switch to one common box for uniform pages.
Does it delete the margins from the file?
No. It sets the crop box, so the content is still there and any editor can reset it. To get a file that contains only the visible area, run the result through Flatten PDF, which renders each page as an image of what the crop box shows.
What about page numbers and headers?
They are ink, so the box includes them. To crop them away, trim that edge by hand with Crop PDF.
Does it work on rotated pages?
Not reliably. Pages that carry a rotation flag are measured in their displayed orientation but cropped in their stored orientation, and on pages turned 90 or 270 degrees the box can collapse to a sliver. Check the output on such files, or crop them by hand.
Related tools
- Crop PDF: set the trims by hand
- Split pages in half: for two-page book scans
- Remove blank pages: drop the empty pages first
- Resize PDF: scale to a standard page size
- Flatten PDF: render only the visible area, making the crop permanent
Part of: Clean up a scan and make it searchable
OCR goes last: the text layer it adds is destroyed by any later rasterising step, and it reads best from pages that are already upright and trimmed.
- 1 Rotate PDF Pages Turn the sideways pages upright, by page or all at once
- 2 Auto-Crop PDF Margins Trim the scanner margins to the ink on each page
- 3 Remove Blank PDF Pages Drop the empty backs by measuring ink, not text
- 4 Compress PDF Rasterise the JPEG pages at a lower DPI if the file is huge
- 5 PDF OCR Recognise the text and put a searchable layer behind the image
Part of: Digitise a scanned book
Interleave before you split: a two-pass scan of spreads has to be in reading order before each spread is cut into two pages.
- 1 Interleave Two PDFs Zip the front pass and the back pass into one ordered file
- 2 Split PDF Pages in Half Cut each two-page spread into two single pages at the gutter
- 3 Auto-Crop PDF Margins Remove the black scanner border around every page
- 4 Remove Blank PDF Pages Drop the blank leaves between chapters
- 5 PDF Bookmark Editor Add a chapter outline so the sidebar is navigable
- 6 PDF OCR Make the text selectable and searchable