PDF to image: picking the right DPI (and when 300 is waste)

How many pixels a PDF page becomes at 96, 150, 300 and 600 DPI, what that does to file size and memory, and which DPI fits screens, OCR and print.

On this page

"Export at 300 DPI" is the advice people give for every PDF-to-image job, and it is often wrong. A PDF page has no pixels at all, so the DPI you choose decides how many it gets, and each step up multiplies the cost. This article works through what the number means, what it does to an A4 page, and how to pick the lowest DPI that still does the job. Every size below was computed with the PDF to images tool's own sizing code.

A PDF page is measured in points, not pixels

Inside a PDF, positions and sizes are in points: 72 points to the inch. An A4 page is 595.28 × 841.89 points (210 × 297 mm); US Letter is 612 × 792. Text and vector drawings are stored as shapes, not as dots, which is why you can zoom a PDF to 800% and the letters stay sharp.

To make an image, a renderer has to decide how many pixels to put in each inch. That is the DPI (strictly PPI, pixels per inch, but everyone says DPI). The pixel size follows directly:

pixels = points × DPI ÷ 72

For A4:

DPIImage size (px)MegapixelsMemory while drawn
72595 × 8420.502.0 MB
96794 × 11230.893.6 MB
1501240 × 17542.178.7 MB
2001654 × 23393.8715.5 MB
3002480 × 35088.7034.8 MB
6004961 × 701634.81139.2 MB

The memory column is the canvas the page is drawn on: 4 bytes per pixel (red, green, blue, alpha). The important pattern is in the megapixels: doubling the DPI multiplies the pixel count by four. 300 DPI is four times the pixels of 150 DPI, and 600 is sixteen times.

What happens to the file size

File size does not grow as fast as pixel count, because image formats compress the empty white areas very well. To get real numbers, I rendered one A4 page of plain 10-point text with pdf.js and encoded it with the Skia encoder (through @napi-rs/canvas in Node.js; browsers use different encoders, so expect your sizes to differ somewhat, not the trend):

  • 150 DPI: PNG 617 KB, JPG (quality 90) 573 KB, WebP (quality 90) 343 KB
  • 300 DPI: PNG 1.33 MB, JPG 1.47 MB, WebP 800 KB
  • 600 DPI: PNG 2.68 MB, JPG 3.59 MB, WebP 1.60 MB

For this text page, each doubling of the DPI roughly doubled the file, while the pixel count quadrupled. A page full of photographs behaves differently: there is detail everywhere, so the file grows closer to the pixel count. Notice also that JPG is not smaller than PNG for a text page at 300 DPI. JPG is built for photographs; on black-on-white text it spends bytes on the ringing around every letter edge.

The memory figure matters more than the file size on phones. A 600 DPI A4 page needs a 139 MB canvas, and mobile browsers cap canvas size well below what a desktop allows. That is why the tool limits each image to 25 megapixels and draws a larger page at the highest DPI that fits, telling you before it starts.

Pick the DPI by where the image is going

On a screen. What matters is how many pixels the image will occupy on the display. A phone that is 390 CSS pixels wide with a device pixel ratio of 3 has 1170 physical pixels across. An A4 page shown full width on it needs about 1170 pixels: 150 DPI (1240 px) is enough, 300 DPI is wasted, and 96 DPI (794 px) looks soft. On a laptop showing the page at 1000 CSS pixels wide on a 2× display, you need 2000 pixels, which is about 240 DPI. For slides, chats and email, 150 DPI is the sensible default.

For text recognition (OCR). OCR engines care about how tall the letters are in pixels. Tesseract's own guide on improving quality says it "works best on images which have a DPI of at least 300 dpi". In pixels, 10 pt text at 300 DPI is about 42 px of type size; at 150 DPI it is half that. For OCR, render at 300 DPI, and never below 200 for normal body text.

For printing. Here 300 DPI really does make sense, because you print the image at the page's own size and 300 pixels per inch is about what the eye resolves at reading distance. An A4 page at 300 DPI prints at A4 with no visible pixels. Printing it smaller than A4 raises the effective DPI further, which gains nothing.

For a thumbnail or a preview. 72 or even 36 DPI. A contact sheet of 40 pages at 300 DPI is 348 megapixels for pictures that will be shown 200 pixels wide.

When higher DPI adds nothing

Many PDFs are scans: each page is a photograph of paper stored inside the PDF at the resolution of the scanner, often 200 or 300 DPI. Rendering such a page at 600 DPI does not reveal finer detail; the renderer simply stretches the stored picture, and you get a file four times larger that looks the same, or slightly blurrier. If you want the scan's original pixels, render at the scan's own DPI. (Poppler's pdfimages -list shows the stored resolution of each image, if you have it installed.)

The same applies to charts that were pasted into a document as low-resolution screenshots. Vector text around them will sharpen at a higher DPI; the screenshot will not.

Common mistakes

  • Using 300 DPI for everything. It costs four times the pixels of 150 DPI and, for screen use, buys nothing you can see.
  • Choosing JPG for text pages. JPG is fine for scans and photos. For typed documents, PNG gives crisp edges and is often as small; WebP is usually the smallest of the three.
  • Expecting selectable text. An image is pixels. Keep the PDF if anyone needs to search or copy the text.
  • Forgetting the transparent background. Most PDFs have no white page at all, just text on nothing; a viewer paints white behind it. If you place the image on a coloured slide, choose PNG with a transparent background, or keep it white on purpose.
  • Resizing afterwards. Rendering at 300 DPI and then shrinking to half size in an image editor gives a worse result than rendering at 150 DPI directly, and takes longer.

A quick recipe

  1. Open the PDF in the PDF to images tool; it shows the first page's size in millimetres and inches.
  2. Choose 150 DPI for screens, 200 to 300 for OCR, 300 for print.
  3. PNG for typed pages, JPG for photos and scans, WebP for the web.
  4. Convert only the pages you need (1-3, 7), then download the ZIP.

If you need the opposite direction, photos into one PDF, or to merge, split and rotate the original file first, the PDF toolkit does that in the same way, on your device. And if the images turn out larger than you wanted, the image toolkit can resize and recompress them in bulk.

Tools mentioned in this article

Back to the blog