Why "trim the white margins" is harder than it looks
Every free PDF cropper gives you four boxes to type numbers into, and then you guess, download, look, and guess again.
What people actually want is a button that says "get rid of the white edges". That requires knowing where the ink is on each page, and that is the part most tools skip.
This one measures it. Before cropping, every page is passed through the same rendering engine that powers the compressor here, running in a mode that draws nothing and simply reports the bounding box of the marks on the page. Ghostscript has to work that out anyway in order to render anything, so asking it is exact and costs almost nothing. On a test page with content drawn at a known position, the measurement came back accurate to within 0.02 of a point — about a hundredth of a millimetre.
The two modes, and which one you want
Keep every page the same size is the default, and it is what you want for anything you will print or scroll through.
It takes the smallest margin found on each side across the whole document. If page 4 has a wide table that reaches further left than anything else, page 4 sets the left edge for every page. Nothing gets cut anywhere, and the document still behaves like one document.
Crop each page tightest cuts every page down to its own content. Pages come out different sizes. It is genuinely useful when you are pulling figures or diagrams out of a paper, and genuinely annoying when you print the result — a page holding one short paragraph gets cropped to a strip.
The thing you should know before you use this on anything sensitive
Cropping hides content. It does not delete it.
A PDF page carries two boxes: the MediaBox, which is the real sheet, and the CropBox, which is the part a viewer shows you. Cropping sets the CropBox. Everything outside it is still sitting in the file, and anyone can widen the box in thirty seconds and see it again.
This matters because "crop out the sensitive bit" is a completely reasonable-sounding idea that does not work. If you need something gone, you need redaction, and redaction means removing the content itself.
We verified this behaviour rather than assuming it: after cropping, the MediaBox of the output is still the full original page.
A margin of 2 mm is left on purpose
Automatic mode leaves about 6 points — roughly 2 mm — around the detected content, rather than cutting exactly at the edge of the ink.
Cropping flush to the measured bounds looks wrong. Descenders on letters like g and y, the antialiased edge of a scanned character, and the outer stroke of a table border all sit within a point or two of the boundary, and shaving them makes a page feel cramped in a way that is hard to name but easy to see.
When manual mode is the better tool
Automatic mode is the right answer when the margins are white. It is the wrong answer when they are not — a page with a header rule, a footer with a page number, or a printed border will have "ink" out at the edges, so there is nothing for it to trim.
In that case, set the numbers yourself. Millimetres, one per edge, applied to every page.