Crop a PDF Online Free (Trim Margins) [2026]
Cropping a PDF should not require uploading it to a server you do not control. SammaPix PDF Crop runs entirely in your browser β set per-side margins, preview the result live, and download the cropped file without any upload. Here is how it works and what setCropBox actually does.

Table of Contents
The problem: most PDF crop tools upload your file
You have a scanned contract or a PDF exported from Word and it is surrounded by thick white margins. You search for "crop PDF online" and land on iLovePDF, Smallpdf, or Adobe Acrobat Online. You drag the file in. A progress bar fills. The file uploads to their server, gets processed remotely, and you download the result.
The cropping worked. But your document spent time on a server you have no visibility into. Their privacy policy says files are deleted within an hour β you cannot verify that claim, and you cannot know whether the file transited other systems during processing.
For bank statements, medical reports, signed contracts, and anything containing personal or financial data, this is a real concern. I built SammaPix PDF Crop to solve this by keeping the entire crop process inside your browser. No server is involved at any point.
What βno uploadβ actually means
When you drop a PDF into SammaPix PDF Crop, your browser reads the file using the FileReader API β a standard browser API for reading local files without network access. The file stays in browser memory throughout. Processing uses pdf.js (Mozilla's open-source PDF renderer, used to generate the live preview) and pdf-lib (an open-source JavaScript library for reading and writing PDF files). The output is served as a blob: URL and downloaded directly from memory. Zero network requests carry your file.
How browser-based PDF cropping actually works
Understanding the mechanism explains why this approach preserves quality while being fast and private. Here is what happens under the hood when you crop a PDF in the browser:
- pdf.js renders a live preview of the page. When you drop the PDF, pdf.js reads and renders the first page into a canvas element. This preview updates as you adjust the margin values, so you can see exactly how much content remains visible before committing to a crop.
- You enter per-side margin values. The top, right, bottom, and left margin inputs are independent. You can crop 20 points from the left without touching any other side. The preview updates instantly.
- pdf-lib sets the CropBox on each page. This is the critical step. pdf-lib reads the existing page dimensions (the MediaBox, which defines the full physical page size), subtracts your margin values from each side, and writes the resulting rectangle as the
CropBoxin the page dictionary. This is a standard PDF property defined in ISO 32000. No content is re-rendered, re-encoded, or touched. - The modified PDF is offered for download. The updated PDF bytes are stored as a Blob in browser memory and downloaded directly. Nothing leaves your device.
The key insight is that the PDF format has a built-in, standardized way to specify the visible display area of each page. pdf-lib simply writes that rectangle into the file. No pixels are touched, no content is re-encoded β which is why text stays selectable and quality stays identical.
What setCropBox does β and what it does not do
The PDF specification defines five page boundary boxes. The two you need to understand for cropping are:
MediaBox β the full physical page
The MediaBox defines the full extent of the page, including any content outside the visible display area. Think of it as the physical sheet of paper β it encompasses everything. When a PDF viewer opens a file, the MediaBox sets the maximum dimensions of the page.
CropBox β the visible display area
The CropBox defines the region of the page that PDF viewers display and print. When you set a CropBox smaller than the MediaBox, the viewer shows only the CropBox area. Content between the CropBox boundary and the MediaBox boundary is still present in the file β it is simply hidden from the viewer.
This has a practical implication: cropping via setCropBox is lossless. The original content is preserved. If you open the cropped PDF in a viewer that exposes the MediaBox (some professional tools do), you could still see the hidden content. For most use cases β trimming scanner borders, removing excess whitespace for e-reader display, fitting content to a tighter layout β this is exactly the right tool. For full content deletion, you would need a dedicated redaction tool like PDF Redact.
| Property | What it defines | Effect of cropping |
|---|---|---|
| MediaBox | Full physical page size (unchanged by cropping) | Not modified β original dimensions preserved |
| CropBox | Visible display area shown to the viewer | Set to MediaBox minus your margin values |
Per-side margin control: top, right, bottom, left
The most powerful aspect of the SammaPix PDF Crop tool is independent control over each side of the margin. Most online cropping tools offer only a single βmarginβ value that applies equally to all four sides. That is rarely what you need in practice.
Typical real-world scenarios
- Flatbed scanner border on three sides: the scanner glass produces a thin black border along the top, left, and bottom but not the right. You need different values for each affected side.
- Bound document scan: a book or folder scanned with a wide binding margin on the left. You want to trim only the left side to balance the layout without touching the right margin.
- Header and footer removal: a PDF with a large header on top and a footer at the bottom that you want hidden. Crop only top and bottom, leaving the left and right untouched.
- E-reader or tablet optimization: a two-column academic paper with wide outer margins. Crop the outer margins on both sides to maximize the text area on the screen. We cover this in depth in the companion article How to Remove White Margins from a PDF (No Upload).
The tool translates each margin input into the corresponding change to the CropBox coordinates. For a standard A4 page (595 x 842 points), cropping 40 points from the left and 20 from the top produces a CropBox of [40, 0, 595, 822] β precise arithmetic applied directly to the page dictionary.
Text stays selectable β no rasterization
Some PDF crop tools work by rendering every page to a pixel image (rasterization), cropping the image, and assembling a new PDF from the cropped images. This approach produces a visually cropped PDF but destroys all structure:
- Text becomes an image. You cannot select, copy, or search the text in the output PDF.
- Quality degrades. Re-encoding pages as JPEG introduces compression artifacts, especially on sharp text edges and fine line graphics.
- File size changes unpredictably. Rasterization can inflate a 1 MB text PDF to 5 MB or more, depending on the page resolution and JPEG quality settings used by the tool.
SammaPix PDF Crop does none of these things. pdf-lib modifies only the CropBox entry in the page dictionary. The page content stream is completely untouched. After cropping:
- Text is still selectable and copyable
- The document is still searchable (Cmd+F / Ctrl+F)
- Images remain at their original resolution and quality
- Vector graphics stay crisp at any zoom level
- Hyperlinks remain active
- File size is essentially unchanged
Crop your PDF margins in your browser, no upload
No upload, no rasterization, no quality loss. Text stays selectable. Per-side margin control. Live preview via pdf.js. Free, no signup.
Open PDF Crop, FreeHow to crop a PDF without uploading it, step by step
The full process takes under a minute for most documents:
- Go to sammapix.com/tools/crop-pdf in Chrome, Safari, Firefox, or Edge. No account required.
- Drop your PDF onto the dropzone or click to browse for it. pdf.js renders a live preview of the first page. You will see the current page with its existing margins, so you have a reference point before making any adjustments.
- Enter your crop values for each side. Type the amount to remove from the top, right, bottom, and left. The values are in points by default (1 point = 1/72 inch; an A4 page is 595 x 842 pt). The preview updates as you type.
- Review the preview. Confirm the visible area looks correct and that no important content is being cut off. Adjust the margin values if needed.
- Click Crop PDF. pdf-lib sets the CropBox on every page using the margin values you entered. This is applied uniformly across all pages in the document.
- Download the result. The cropped PDF is served from browser memory as a Blob. No network request occurs.
When you need to crop a PDF: common scenarios
PDF cropping comes up in a handful of recurring workflows. Here are the most common ones:
Removing scanner borders from scanned documents
Flatbed scanners almost always capture a thin black or gray border around the document β the edge of the scan bed. This border is irrelevant and distracting. Cropping a few points from each side removes it cleanly, producing a borderless scan. Per-side control is essential here because the border is rarely perfectly uniform.
Preparing PDFs for e-reader or tablet reading
Academic papers, technical reports, and book chapters exported as PDFs often have wide margins designed for A4 or Letter paper. On an e-reader or tablet, those margins consume screen space and force the text to render smaller. Cropping the margins β especially on academic two-column layouts with wide outer margins β significantly increases the readable text size. See the full guide at How to Remove White Margins from a PDF (No Upload).
Cropping a print-ready PDF before screen sharing
Print-ready PDFs include bleed and slug areas β extra space outside the trim edge used during printing. When sharing PDFs for review or presentation, those areas look unprofessional on screen. Cropping to the TrimBox area (the actual intended page size) removes the bleed and slug without affecting any content.
Hiding a header or footer before sharing
If a PDF has a prominent header with your organization name or a footer with internal document codes that should not be visible in a shared version, cropping the top or bottom margin is a fast way to hide them. Keep in mind that setCropBox hides rather than deletes β if complete removal is required, use PDF Redact instead.
Matching a non-standard crop for a slide deck export
Presentation tools sometimes export slides with additional white space around the slide area β especially when exporting to PDF from Keynote, Google Slides, or LibreOffice Impress. Cropping those borders makes the slides fill the page correctly when viewed or re-imported.
Browser-based vs upload-based PDF cropping: honest comparison
Here is an objective comparison of the two approaches across the dimensions that matter most:
| Dimension | Upload-based (iLovePDF, Smallpdf, Adobe Online) | Browser-based (SammaPix) |
|---|---|---|
| Privacy | File uploaded to a remote server. You trust their security and deletion policies. | File never leaves your device. Verifiable via browser Network inspector. |
| Text selectability after cropping | Depends on the tool. Some rasterize pages (text becomes image). Good tools set the CropBox. | Always preserved. pdf-lib only sets the CropBox β no rasterization, ever. |
| Per-side margin control | Varies. Many offer only a single symmetric margin value. | Yes. Independent top, right, bottom, left inputs. |
| File size change after cropping | May increase or decrease significantly if the tool rasterizes pages. | Essentially zero change. Only the CropBox dictionary entry is updated. |
| Live preview before cropping | Varies. Some require uploading and processing to see the result. | Yes. pdf.js renders a live preview that updates as you type margin values. |
| File size limits | Free plans typically cap at 5 to 25 MB. Larger files need a subscription. | Limited by device memory. No artificial cap. No server involved. |
| Signup required | Often required beyond basic free use. | No account required. |
How to verify no upload happens
You do not have to take my word for it. Here is how to confirm this yourself in under two minutes:
- Open DevTools. Press F12 (Windows/Linux) or Command Option I (Mac) in your browser. On Safari, enable the Develop menu first in Settings β Advanced.
- Go to the Network tab. Click Network in DevTools. Clear any existing entries.
- Drop your PDF, adjust margins, and click Crop PDF. Watch the Network panel as the live preview renders and as you click Download.
- Observe: no outgoing requests carrying your file. The only network activity is the initial page load (JavaScript and CSS assets). During preview rendering, margin adjustments, and download, the Network panel shows zero outgoing requests. The PDF is processed and served entirely from browser memory.
This is the standard method used by privacy researchers to audit browser-based tools. It is conclusive: if no network request carries your PDF bytes, the file stayed on your device.
Your PDF stays on your device
No upload, no account, no server. Per-side margin control. Live preview. Text stays selectable. The CropBox is set by pdf-lib on every page. Free.
Other PDF tools that run in your browser
SammaPix offers a full suite of browser-based PDF tools. All of them run locally with no upload and no server processing:
- PDF Crop: set CropBox margins per side β top, right, bottom, left. Live preview. Text stays selectable. No upload.
- PDF Compress: reduce file size by rasterizing and re-encoding page images. Best for scanned documents and image-heavy PDFs. Read the full guide at Compress a PDF online without uploading it.
- PDF Rotate: fix sideways pages permanently. Rotation is written into the page Rotate property β not a viewer-level display setting. Read the full guide at Rotate a PDF online without uploading it.
- Remove PDF Pages: delete any page or range of pages from a PDF. Thumbnail grid and range input. Read the full guide at Delete pages from a PDF online free.
- PDF Organize: reorder pages by dragging thumbnails, then download the rearranged PDF. No upload.
All your PDF needs, all in-browser
Crop, compress, rotate, remove pages, and organize PDFs without uploading them anywhere. All tools run locally in your browser via pdf.js and pdf-lib. No server. No signup. No watermark.
FAQ
Does cropping a PDF online mean uploading it to a server?
With most tools, yes. iLovePDF, Smallpdf, Adobe Acrobat Online, and similar services upload your PDF to their servers for processing. With SammaPix PDF Crop, no. The cropping runs entirely in your browser using pdf.js (to render a live preview) and pdf-lib (to set the CropBox on each page). Your file never leaves your device. You can verify this yourself by opening your browser's Network inspector (F12) and watching for outgoing requests while the tool processes your file. You will see none.
What does setCropBox actually do in pdf-lib? Is the cropped content deleted?
The CropBox is a PDF standard property that tells viewers which region of the page to display. When pdf-lib sets the CropBox, it narrows the visible area of the page to the rectangle you defined β the content outside that rectangle is hidden but still present in the file. This is both a strength and a limitation. The strength: the operation is lossless, instant, and does not re-encode any content. Text stays selectable. The limitation: the cropped content is not permanently deleted β it is just hidden. If you need to permanently remove content from the margins, you would need a full redaction workflow (which is different from cropping).
Can I crop different amounts from different sides of the PDF?
Yes. The tool provides four independent margin inputs: top, right, bottom, and left. You can crop 20mm from the left and 5mm from the top while leaving the right and bottom untouched. This per-side control is useful for scanned documents that have uneven margins from the scanner, or for PDFs where the binding margin is only on one side.
Does cropping affect text selectability or image quality?
No. SammaPix PDF Crop uses pdf-lib to set the CropBox β it does not rasterize the page or re-render anything. The page content stream is completely untouched. After cropping, text in the remaining visible area is still selectable and searchable, images remain at their original resolution and quality, vector graphics stay crisp at any zoom level, and hyperlinks remain active. Only the visible display area changes.
Does the file size change after cropping a PDF?
No, or negligibly. Setting the CropBox via pdf-lib only adds or updates a small dictionary entry in each page object. The page content itself is not changed, re-encoded, or compressed. The output file size is essentially identical to the input. This is a key advantage over rasterization-based approaches, where every page gets re-encoded as a JPEG image and the file size can change dramatically.
Will the cropping apply to every page in the PDF?
Yes. SammaPix PDF Crop applies the same margin values to every page in the document. The CropBox is set page by page using pdf-lib, but the margin values you enter are applied uniformly across all pages. This is the correct behavior for the most common use case: removing consistent scanner borders or white margins that appear on every page of a scanned document.
Can I crop a password-protected PDF?
No. pdf-lib cannot modify a password-protected or encrypted PDF without the owner password, because the file content is encrypted and the library cannot write changes to the page structure. If your PDF is protected, you need to unlock it first. SammaPix offers a separate PDF Unlock tool that removes owner-level restrictions from PDFs that you are authorized to modify.
How do I verify no upload happens when I crop a PDF?
Open your browser developer tools (F12 on Windows/Linux, Command Option I on Mac), click the Network tab, then drop your PDF into the SammaPix PDF Crop tool and proceed through margin entry and download. Watch the network panel throughout. You will see requests for static page assets (JavaScript, CSS) when the tool loads. During preview rendering, margin adjustments, and the download step, you will see zero outgoing requests. The PDF is read by the FileReader API, processed entirely in memory by pdf-lib, and the output is served via a blob URL β no network call is made at any point.