How to Resize an Image in Pixels (and Convert Inches, cm and DPI to Pixels)
Resize Image works in pixels. This guide shows how to choose width, height and fit mode, and how to convert print sizes in inches or centimeters into pixels first.
DocsEngine Editorial Team
Resize Image scales photos to the pixel size you type.Key Takeaways & Executive Summary
Resize Image takes pixels only: Target Width (px), Target Height (px, 0 = auto) and a Scaling Fit Mode.
Leave the height at 0 to keep the proportions; type both values for an exact box.
To work from a print size, use pixels = inches × DPI, and inches = cm ÷ 2.54. A 4 × 6 inch print at 300 DPI is 1200 × 1800 px.
Resizing uses Lanczos-3 resampling, which keeps edges sharp and smooth when you shrink a photo.
No DPI value is written into the file. Set the print size when you print.
Table of Contents
How to resize an image to exact pixels (quick answer)
Step by step: resize a photo in your browser
Contain, Cover or Stretch: the three fit modes
Converting inches, centimeters and DPI to pixels
Why the resampling filter matters
Limitations: what Resize Image doesn’t do
Privacy: resizing happens on your device
Frequently Asked Questions
Sources
How to resize an image to exact pixels (quick answer)
Step by step: resize a photo in your browser
Contain, Cover or Stretch: the three fit modes
Converting inches, centimeters and DPI to pixels
Why the resampling filter matters
Limitations: what Resize Image doesn’t do
Privacy: resizing happens on your device
Frequently Asked Questions
Sources
How to resize an image to exact pixels (quick answer)
Open Resize Image, add your photo, type the width you want into Target Width (px) and leave Target Height (px, 0 = auto) at 0. Click Resize Image and download the result: the height is calculated for you, so the photo keeps its shape.
If you start from a print size instead of pixels, convert it first: multiply inches by the DPI you need, or divide centimeters by 2.54 to get inches. The tool has no inch, centimeter or DPI fields, so the math below gives you the numbers to type.
Step by step: resize a photo in your browser
You can add up to 50 images; they are all resized with the same settings.
- Open Resize Image and click Choose Files, or drop your images onto the page.
- Type the width in Target Width (px). The default is 800.
- Leave Target Height (px, 0 = auto) at 0 to keep the proportions, or type a height to resize into an exact box.
- If you typed both values, choose a Scaling Fit Mode: Contain (Preserve ratio), Cover (Fill & Crop) or Stretch.
- Click Resize Image, then Download File, or Download All (ZIP) when you resized several images.
Contain, Cover or Stretch: the three fit modes
The fit mode only matters when you set both width and height and the box has a different shape from your photo. The table uses a 4000 × 3000 px photo resized into a 1200 × 1200 px box.
| Scaling Fit Mode | What happens | Result for 4000 × 3000 into 1200 × 1200 | Use it for |
|---|---|---|---|
| Contain (Preserve ratio), default | Fits the whole photo inside the box and keeps its shape | 1200 × 900 px, nothing cut off | Staying within a maximum size |
| Cover (Fill & Crop) | Fills the box exactly and trims the overflow evenly from both sides | 1200 × 1200 px, left and right edges trimmed | Thumbnails, avatars, fixed slots |
| Stretch | Forces both sizes and changes the shape | 1200 × 1200 px, picture squashed | Only when distortion does not matter |
Converting inches, centimeters and DPI to pixels
DPI (dots per inch, often used to mean pixels per inch) only matters when an image is printed. A screen shows pixels, so for websites and apps you work in pixels directly. For print, the pixel count decides how large the image can be printed at a given sharpness.
The formulas are simple: pixels = inches × DPI, and inches = cm ÷ 2.54 (or mm ÷ 25.4). The examples below use 300 DPI; ask your print shop which resolution it wants.
The file stores pixels, not DPI
Resize Image does not write a DPI value into the file. That makes no difference on screens. When you print, set the size (for example 4 × 6 inches) in the print dialog or tell the print shop; a 1200 × 1800 px image printed at that size works out to 300 DPI.
- 4 × 6 inch photo print: 4 × 300 = 1200 and 6 × 300 = 1800, so 1200 × 1800 px.
- 2 × 2 inch photo (the U.S. passport photo size given by the U.S. Department of State): 600 × 600 px.
- 10 × 15 cm print: 10 ÷ 2.54 × 300 ≈ 1181 and 15 ÷ 2.54 × 300 ≈ 1772, so about 1181 × 1772 px.
- A4 page (210 × 297 mm): 210 ÷ 25.4 × 300 ≈ 2480 and 297 ÷ 25.4 × 300 ≈ 3508, so about 2480 × 3508 px.
- US Letter page (8.5 × 11 inches): 2550 × 3300 px.
Why the resampling filter matters
When an image changes size, every new pixel has to be calculated from the old ones. The simplest method, nearest neighbor, copies the closest pixel and leaves blocky, stair-stepped edges. Bilinear blends the four nearest pixels, which is smooth but soft.
Resize Image uses Lanczos-3, a windowed-sinc filter that weighs a wider neighborhood of surrounding pixels than bilinear does. It keeps edges sharp and smooth when you make a photo smaller. The work runs in a background worker, so the page stays responsive while large images are processed.
Resize Image can also enlarge, but no filter can add detail that the photo never had: a 400 px image stretched to 2000 px will look soft. For bigger enlargements, try the AI Image Upscaler, which generates plausible detail at 2× or 4×.

Limitations: what Resize Image doesn’t do
It works in pixels only: there are no percentage, inch, centimeter, millimeter or DPI fields, and no DPI is written into the file. For a percentage, multiply first; 50% of a 3000 px wide photo is 1500 px.
There is no format or quality choice. The output keeps the input format (HEIC becomes JPG; TIFF, AVIF and SVG become PNG), and JPG and WebP are saved at 92% quality. To reach a file-size limit afterwards, use Compress Image. Cover always trims from the center; to decide what stays, use Crop Image first.
Sizes are limited by your device. Very large photos are scaled down when opened (desktop browsers handle up to 64 megapixels or 16,384 px on a side, iPhone and iPad 16 megapixels or 4,096 px), and a target larger than the browser can create is refused with a message. Animated GIFs keep only their first frame.
Privacy: resizing happens on your device
Resize Image runs in your browser, so your photos never leave your device. Each resized file is re-encoded, which drops EXIF, GPS and XMP metadata.
No upload unless you agree
If a file is too large for your device, the page can offer to process it on our server and uploads only if you agree. Then the file is sent over HTTPS and deleted as soon as processing finishes, and the result is deleted right after you download it, or 10 minutes after processing if you never download it.
Resize your images to exact pixels
Type a width, keep the proportions, download. Resizing runs in your browser.
Frequently Asked Questions
About 1181 × 1772 px. Divide each side in centimeters by 2.54 to get inches, then multiply by 300.
Shrinking a photo with Lanczos-3 keeps it looking sharp. Enlarging spreads the same detail over more pixels, so it looks softer; the AI Image Upscaler is the better choice for big enlargements.
Yes for PNG and WebP, because the output keeps the input format. JPG has no transparency.
With Contain (Preserve ratio) the whole photo is fitted inside the box, so one side can come out shorter. Choose Cover (Fill & Crop) to fill the box exactly.
Sources
- U.S. passport photo requirements (U.S. Department of State)
- MDN: Web Workers API (MDN Web Docs)
- MDN: Image file type and format guide (MDN Web Docs)
Table of Contents
How to resize an image to exact pixels (quick answer)
Step by step: resize a photo in your browser
Contain, Cover or Stretch: the three fit modes
Converting inches, centimeters and DPI to pixels
Why the resampling filter matters
Limitations: what Resize Image doesn’t do
Privacy: resizing happens on your device
Frequently Asked Questions
Sources
How to resize an image to exact pixels (quick answer)
Step by step: resize a photo in your browser
Contain, Cover or Stretch: the three fit modes
Converting inches, centimeters and DPI to pixels
Why the resampling filter matters
Limitations: what Resize Image doesn’t do
Privacy: resizing happens on your device
Frequently Asked Questions
Sources
Resize Image
Free, no sign-up. Runs in your browser, so your files never leave your device.
Share this guide


