Processed in browser · pdf.js + pdf-lib

Crop PDF Pages Online — drag a box, type exact preview coordinates, or lock a standard ratio

Trim scanner margins, isolate a figure or QR code, or keep a precise part of a page — drag the crop box or enter exact preview coordinates.

See how it works
Draggable crop box Exact preview coordinates A4 / Letter / Square presets Current, all, or specific pages Browser-based processing
Built & maintained by Bhavin J. Sheth | Updated

The cropping console

Upload a PDF, define the crop area, and apply it to the pages you choose.

Drop your PDF here

or browse files

How cropping actually works

Cropping changes the page boundary, not the selected content

Cropping changes the page boundary rather than rasterizing the selected content. The area you keep remains part of the PDF instead of being converted into a new image.

Two ways to define the box

A scanned book comes with dark scanner borders. A ticket has a QR code buried in a full page of legal text. A blueprint is too large to focus on one room. Each of these needs the same operation — keep this rectangle, discard everything outside it.

You can draw that rectangle by hand, dragging it and its eight corner and edge handles directly on the live preview, or type exact Left, Top, Width, and Height preview values for precise control. Either way, pdf-lib writes the new page boundary into the file — pdf.js keeps the preview in sync as you adjust it.

What you're actually setting

Position and size

Drag the box to move it, or pull any of the eight handles to resize it — the coordinate fields update as you go.

Preview coordinates

Type Left, Top, Width, and Height directly when you need a repeatable, precise result in the preview instead of a freehand drag.

A standard proportion

One click locks the box to A4, Letter, or Square in either orientation, or resets it to the whole page.

Which pages it applies to

The current page, every page, or a typed range like "1, 3-5, 10" — the same box, applied across your choice.

Content retention

Content inside the final box is not rasterized by the crop operation; the selected area keeps its existing PDF content while the visible page area becomes smaller.

Four steps to a trimmed page

A default box appears the moment your file loads — adjust it rather than starting from nothing.

1

Upload your PDF

Drag it onto the upload area, or click Select PDF. A default crop box appears on the first page immediately.

The default box covers about 80% of the page, leaving a margin around the edges.
2

Adjust the crop area

Set it visually, precisely, or with a preset:

Visually: drag the box to move it, or pull a corner or edge handle to resize.
Precisely: type exact Left, Top, Width, and Height preview values.
With a ratio: lock it to A4, Letter, or Square.
3

Crop and export

Once the shaded area covers only what you want removed, click Crop PDF. pdf-lib writes the new boundary into every page you selected.

Processed in your browser — no server-side processing.
4

Check, then download

Page through the cropped file to confirm the boundary, rename it if you like, then download.

Full-file preview Content stays in PDF format

From scanner margins to clean content

The dark shaded area is outside the crop — the selected content remains in the exported PDF.

As scanned Wide margins
Scanned PDF page with wide dark margins and borders before cropping

Gray borders, shadows, and blank edges surround the actual content.

Cropped
After crop Content only
Same PDF page tightly cropped to the content after cropping

Only the content remains — margins, borders, and shadows removed.

Documents where margins are wasted space

Cases where the page holds far more than the part you actually need.

Common situations for cropping PDF pages, by user type
SituationWhat to cropTypical user
Scanned booksTrim scanner borders, dark edges, and shadows from every page for a cleaner read.Students & researchers
E-tickets & QR codesIsolate just the QR code and essential info from a full-page ticket for faster scanning.Travelers & event-goers
Research articlesExtract a specific figure, table, or paragraph from a dense journal page.Academics & writers
Blueprints & plansCrop large-format drawings to focus on a single room, floor, or detail.Architects & engineers
Invoices & receiptsRemove blank edges from scanned receipts before submitting expense reports.Accountants & freelancers
Sheet musicTrim blank margins so scores fit neatly on a tablet screen.Musicians & teachers
Design proofsCrop mockups to final trim size before sending to clients or print.Designers & print shops
ID documentsCrop an ID scan to the document area when a form or workflow requires a tighter page boundary.Admin & compliance staff
Coordinate reference

What each preview coordinate actually controls

The four number fields give precise control over the crop area shown in the preview.

Left (X) and Top (Y)

Left and Top position the crop box within the rendered preview. Increasing Left moves the box right; increasing Top moves it down.

Width and Height

Width and Height control the size of the crop area in the rendered preview. The selected rectangle defines the page area that remains visible.

Ratio presets

A ratio like 0.707 (A4 Portrait) locks Width÷Height to that paper proportion — useful when you're re-cropping toward a standard paper proportion.

What gets removed

The dark shaded region outside the box is hidden in the output. Cropping changes the visible boundary without rasterizing the selected content.

When the crop box won't cooperate

Identify the problem, then use the matching fix.

Symptom
Why it happens
Fix

The crop box doesn't appear

The overlay only draws once the PDF has fully rendered.

Wait a moment for the preview to finish loading, or re-upload the file.

Cropped file is missing content you wanted

The box was smaller than the area you actually needed.

Click Whole Page to reset, then drag the edges inward only as far as the margins.

Crop looks different on other pages

The document mixes page sizes or orientations, so the same pixel box scales proportionally per page.

Apply to same-size pages together, or use a ratio preset for a consistent result across mixed sizes.

Typing a coordinate doesn't move the box

Values are in preview pixels and must fit inside the visible canvas.

Keep Left+Width and Top+Height within the preview's pixel dimensions.

A preset shrinks the box a lot

The chosen ratio doesn't match the page's own aspect, so it fits to the smaller dimension.

Click Whole Page first, or pick the preset whose orientation matches the page.

Can't drag the box on a phone

Touch gestures can sometimes compete with page scrolling on mobile browsers.

Touch dragging and resizing are supported directly — if it still doesn't respond, use the coordinate fields instead.

Crop applied to the wrong pages

The wrong "Apply to Pages" option was still selected.

Re-check Current, All, or Specific before clicking Crop PDF.

Output file is about the same size

Cropping hides area without rasterizing the underlying file.

Run the cropped file through Compress PDF to shrink it for sharing.

The crop box doesn't appear

Why: The overlay draws only after the render finishes.

Fix: Wait for the preview or re-upload.

Missing content after cropping

Why: Box was smaller than the needed area.

Fix: Whole Page, then shrink inward.

Crop differs on other pages

Why: Mixed page sizes scale proportionally.

Fix: Group same-size pages or use a ratio preset.

Coordinate field doesn't move the box

Why: Value falls outside the canvas.

Fix: Keep within the preview's pixel dimensions.

A preset shrinks the box a lot

Why: Ratio doesn't match the page's aspect.

Fix: Whole Page, then adjust.

Can't drag the box on a phone

Why: Touch gestures can compete with scrolling.

Fix: Use touch support or coordinate fields.

Wrong pages were cropped

Why: The wrong Apply to Pages option was set.

Fix: Re-check the option before cropping.

Output file is about the same size

Why: Cropping changes page boundary without rasterizing.

Fix: Run it through Compress PDF after.

Getting a clean crop without redoing it

A working order that avoids the most common redo.

Keep a copy of the original

A crop can't be undone from the downloaded file — keep the source PDF so you can re-crop with different bounds if needed.

Start from Whole Page and shrink inward

Reset to the full page, then drag the edges inward until only the unwanted margin is shaded — faster and more accurate than drawing from scratch.

Lock the ratio first

Lock the A4 or Letter ratio first, then fine-tune the position of the crop area.

Apply to all pages only for uniform scans

Use All Pages when every page shares the same border — for mixed layouts, crop pages in same-size groups instead.

Check the shaded area before finalizing

The dark region outside the box is what gets removed — confirm nothing important sits there before clicking Crop PDF.

Compress afterward if size matters

Cropping hides area without rasterizing the file — run the result through Compress PDF before emailing or uploading it.

Questions people actually ask

If something's not covered here, the troubleshooting section above likely has it.

Does this PDF cropper upload my files?

No. The PDF is processed in your browser using pdf.js and pdf-lib; this tool does not upload the document to an AllInOneTools server.

Will cropping reduce the quality of my PDF?

No. Cropping changes the visible page boundary without rasterizing the selected content into a new image.

Can I apply the same crop area to all pages of my document?

Yes. Select All Pages before clicking Crop PDF. The crop area is applied to each selected page; results can differ when pages have different sizes or orientations.

Can I undo a crop after I've downloaded the file?

No — the download is a new cropped PDF. To change the crop, re-upload the original PDF and crop it again, so it's best to keep the original file.

What happens to my file after I'm done?

Nothing — the PDF is not uploaded to our server. The cropped PDF is generated in your browser and downloaded as a new file.

Can I crop to a specific aspect ratio like A4 or Square?

Yes. Use the preset buttons (A4 Portrait, A4 Landscape, Letter Portrait, Letter Landscape, or Square) to lock the box to a standard proportion, or type exact Left, Top, Width, and Height preview values.

Does cropping work on scanned PDFs?

Yes. It can crop scanned PDFs as well as regular PDFs. Scanner margins, dark borders, and shadows outside the crop box can be removed while the selected content remains in the document.

Build notes

The write-up on how this was built

Because the draggable box, the eight resize handles, and touch support all run client-side, I wrote up the implementation — coordinate math, pointer-vs-touch event handling, and how pdf-lib rewrites a page's crop and media boxes.

Published on freeCodeCamp

How to Build a Browser-Based PDF Crop Tool Using JavaScript

Covers browser-based PDF processing, page boundary controls, visual crop selection, and client-side document editing that keeps files private on the user's device.

Read the write-up on freeCodeCamp

Written by Bhavin Sheth · Founder, AllInOneTools