inyourbrowser.com

Trim PDF Margins

Cut away the empty white space around the body of a PDF. Drop the file, drag a rectangle to mark where the content starts and ends, and download a tightened copy. Useful for scanner output or PDFs with wide default margins. All processing runs in your browser.

Drop a PDF here or click to browse

How it works

The first page is rendered via pdfjs-dist so you can see exactly where the body of the document sits. You drag the rectangle around the content you want to keep, and the tool converts it into PDF coordinates, allowing for page rotation and offsets. By default each cropped page is then rebuilt as a 216 dpi image of that area, so the trimmed margins are gone from the file and the text on those pages is no longer selectable. Keep text selectable instead sets the MediaBox and CropBox with pdf-lib and leaves the trimmed area in the file.

Processing runs in your browser

All cropping happens inside your browser tab. The preview is rendered with pdfjs-dist and the cropped PDF is written by pdf-lib in memory; our servers are not involved at any point. You can verify this yourself in your browser's DevTools Network tab.

Related operations

To reduce file size after cropping, try compress PDF. To rotate pages before cropping, use rotate PDF. For per-page cropping, split first with split PDF.

Frequently asked questions

How is margin trimming different from cropping?
They are the same operation: both resize the page to a chosen rectangle. Trimming margins usually means cropping tight around the body content to remove white space, which makes the document feel more compact on screen.
Will the result print correctly?
Yes. In both modes each cropped page is the size of the crop rectangle and prints at that size. With the default, the page is an image of the selected area. With Keep text selectable, both the MediaBox and CropBox are set to the rectangle, and the content outside it is clipped: viewers and printers do not show it, but it is still in the file.
Can I crop a scanned PDF with skewed pages?
The crop rectangle is axis-aligned, so it cannot correct skew. Use a deskew step before cropping for best results. The tool itself works fine on straight scans.
Does cropping change the page numbers or layout?
Page count and page order are unchanged, and the page size shrinks to the crop rectangle. With Keep text selectable the content within the crop region is also unchanged. With the default, Remove the cut-off area, it becomes an image, so its text is no longer selectable and its links and form fields are dropped.
Where is my PDF processed?
All processing runs in your browser. pdfjs-dist renders the preview and the cropped pages, and pdf-lib writes the cropped output locally. Our servers are not involved at any point.

Last reviewed September 30, 2026

Other pages for this tool

Related tools

Rotate PDF
Rotate or flip PDF pages 90°, 180°, or 270°. Adjust individual pages or all at once.
PDF to Image
Convert PDF pages to JPEG or PNG images. Download individually or all at once.
Crop image
Crop images to any size, square, or circle shape. Canvas API. Runs in your browser.