Skip to content

Put a PDF page on a website as a PNG, sharp on every screen

By the getPDF team · Published 11 November 2026

The short answer

Pick the dpi from the width the page is shown at: pixels = page width in inches x dpi, and an A4 page is 8.27 inches wide, so 150 dpi gives 1240 px, enough for a page shown up to 620 px wide on a 2x screen. Render it as PNG, which keeps text edges clean, add a second file at 300 dpi in srcset for wider slots, and write alt text that says what the page holds. For more than a page or 2, or text people need to search and copy, link the PDF and use the image as its preview.

Try it here, nothing is uploaded

PDF · any size

PDF to PNG draws the pages on your device; nothing is uploaded. The settings are Resolution (72, 150, 300 or 600 dpi), Pages, Background (white or transparent) and Several pages (as one zip or as separate files).

How many pixels does the page need?

A PDF page has a size in inches, not in pixels. The image gets page width in inches x dpi pixels across: A4 is 8.27 inches wide, US Letter 8.5.

dpi A4 width Letter width In PDF to PNG
72 595 px 612 px a setting
96 794 px 816 px not a setting; use 150 and let the site scale down
150 1240 px 1275 px a setting, the default
200 1654 px 1700 px not a setting; use 300 and scale down
300 2480 px 2550 px a setting

The height follows the page: at 150 dpi an A4 page is 1240 x 1754 px, a Letter page 1275 x 1650. 600 dpi is for small crops; a whole A4 page stops at 407 dpi there, because the tool draws at most 16 million pixels a page. PDF to image DPI has the full table and what each step costs in file size.

Now go from the other end. Your layout shows the image at a width in CSS pixels, and screens with high pixel density draw 2 or more device pixels for each CSS pixel (MDN Web Docs, checked on 5 November 2026). So:

image width = shown width x 2, then pick the first dpi that reaches it.

Shown at 2x screen needs A4 setting Letter setting
300 px (a preview card) 600 px 72 (595 px, close enough) 72 (612 px)
600 px (an article column) 1200 px 150 (1240 px) 150 (1275 px)
800 px (a wide column) 1600 px 300 (2480 px), or 150 for 1x screens 300 (2550 px)
1200 px (full width) 2400 px 300 (2480 px) 300 (2550 px)
A4 page width: 595 px at 72 dpi, 794 at 96, 1240 at 150, 1654 at 200, 2480 at 300. A 600 px column needs 1200 px on a 2x screen, an 800 px column 1600 px.72 dpi595 px96 dpi794 px (not a setting)150 dpi1240 px200 dpi1654 px (not a setting)300 dpi2480 px600 px column at 2x: 1200800 px at 2x: 1600
An A4 page's width in pixels at each dpi, to scale, against the pixels a 600 px and an 800 px column need on a 2x screen.

Will the text be readable?

This is the check most guides skip. The dpi decides how sharp the letters are; the width on screen decides how big they are. An A4 page is 595 points wide, so text of a given point size shows at about:

size on screen in px = point size x shown width / 595 (612 for Letter).

10 point body text on an A4 page shown 600 px wide comes out at about the size of 10 px web text. Shown 400 px wide, on a phone, about 7 px. MDN Web Docs gives 16 px as the usual browser default font size (checked on 5 November 2026); to get 10 point print to that size, the page has to be shown about 950 px wide.

So a whole page works as a preview, a “this is what the form looks like”, or a page with large type such as a poster or a certificate. When the reader has to read the words, show less of the page bigger: cut out the part that matters with Crop PDF first, then render the crop, or put the text on the page as text.

Steps: a page image with srcset

  1. Drop the PDF into PDF to PNG above.
  2. Type the page in Pages, for example 1, or 2, 5-7 for several.
  3. Pick the Resolution from the table: 150 for a column up to about 620 px wide, 300 for wider.
  4. Leave Background on white. Transparent shows your site’s background through the paper, which reads badly on a dark theme; it is for logos and stamps (see a transparent PNG from a PDF).
  5. Press Make the images and download. The file is named after the PDF and the page: page 1 of a 3-page lease.pdf is lease-1.png (in a 10 to 99 page file, lease-01.png).
  6. For srcset, run it again at the other resolution and rename the 2 files so they do not overwrite each other, for example lease-p1-1240.png and lease-p1-2480.png.
  7. Put both in the img tag. MDN Web Docs explains the pattern: each file in srcset with its real width as a w value, sizes saying how wide the slot is, and the browser picks a file for the slot’s width at the screen’s density. width and height set to the image’s own pixel size let the browser keep the space free while it loads.
<img
  src="lease-p1-1240.png"
  srcset="lease-p1-1240.png 1240w, lease-p1-2480.png 2480w"
  sizes="(max-width: 800px) 100vw, 800px"
  width="1240"
  height="1754"
  alt="Page 1 of the lease between Jane Cooper and Karol Michal: rent of 950 euro a month, from 1 December, signed by both."
/>

For the 800 px slot, a 1x screen needs 800 pixels and a browser normally takes the 1240 px file; a 2x screen needs 1600 and normally gets the 2480 px one. MDN notes that the final choice is the browser’s.

Alt text for a page image

MDN Web Docs calls alt mandatory for accessibility: screen readers read it out, and it should say what the image tells the reader, not that it is an image or what the file is called. An image that is only decoration gets alt="".

For a page of a document, say what the page is and what matters on it: whose letter, which form, the key number. Do not paste 400 words into alt. If the reader needs the words, put them on the page as text, or link the PDF, which a screen reader can read when its text is real text.

PNG, JPG or WebP for a text page?

  • PNG stores every pixel exactly. Letters keep clean edges, and a page that is mostly white compresses well. It is the right default for text, tables, forms and charts.
  • JPG is smaller on pages that are mostly photos or scans, and leaves faint marks around sharp letters. PDF to JPG or PNG has the sizes from the same pages both ways.
  • WebP has a lossless mode too; Google’s WebP documentation says lossless WebP files are about 26 % smaller than PNGs (checked on 5 November 2026). getPDF does not write WebP. Make the PNG here, then let your CMS or an image editor save it as lossless WebP, and keep the PNG in src or a picture element for anything that cannot show WebP.

A rendered page carries only pixels and its resolution. Links, selectable text, form fields and the PDF’s metadata do not come along: the image shows what the page looks like, filled fields and notes included, and nothing else.

  • Accessibility. The W3C’s WCAG 2.2 success criterion 1.4.5, Images of Text (level AA), asks for real text rather than pictures of text wherever the look can be made with text, with exceptions where the look is essential, such as a logo (checked on 5 November 2026). A page image as a preview, with the words also on the page as text or in a linked PDF, keeps the words readable; a page image as the only place the words appear is what the criterion warns against.
  • Search. Google lists PDF among the file types it indexes (Google Search Central, “File types indexable by Google”, checked on 5 November 2026). The text in a PDF can be found by search engines and with Ctrl+F; the text in a PNG cannot. If the PDF is a scan, run OCR PDF on it first so its text is real text.
  • Many pages. A 48-page report as 48 images is a heavy page and a poor read. Show page 1 as a preview, as in a PDF cover thumbnail, and link the file.
  • Copying and printing. People copy numbers out of documents and print them. A PDF prints at its own size and keeps its text; an image prints at whatever size the browser picks.

The honest part

PDF to PNG draws pages at 72, 150, 300 or 600 dpi; it does not resize to an exact pixel width, write WebP or AVIF, write your img tag or add alt text. Your CMS usually resizes uploads anyway; otherwise an image editor makes the exact size.

A page image is a picture of a document, never the document. It cannot be searched, its links do not work, and a screen reader hears only the alt text. Use it to show what something looks like, and link the PDF for what it says. For every other way of getting pictures out of a PDF, see PDF to images.

PDF to JPGfor page images that are mostly photos. Free, runs on your device.

Questions

What dpi should I use for a PDF page on a website?

Work it out from the width the page is shown at. Pixels = page width in inches x dpi, and an A4 page is 8.27 inches wide. A page shown 600 px wide needs 1200 px on a 2x screen, which 150 dpi gives (1240 px). Shown 800 px wide, render 300 dpi (2480 px) for 2x screens and 150 dpi for the rest.

PNG, JPG or WebP for a page of text?

PNG or lossless WebP: text edges stay clean, and a mostly white page compresses well. JPG leaves faint marks around letters and suits pages that are mostly photos. getPDF writes PNG and JPG; for WebP, convert the PNG in your CMS or an image editor.

Why is the text on my page image too small to read?

The width on screen sets the text size, not the dpi. An A4 page shown 600 px wide shows 10 point text at about the size of 10 px web text, smaller than the usual 16 px browser default. Show the page wider, crop the part that matters, or link the PDF instead.

Should I put the PDF itself on the site instead?

Often, yes: for more than a page or 2, for text people will search or copy, and for readers who use a screen reader. Google indexes PDFs, and the text in a PDF can be selected and read aloud; a PNG is only pixels. Use an image as a preview that links to the PDF.

Is the PDF uploaded to make the PNG?

No. PDF to PNG draws the pages in your browser on your device and nothing is uploaded, which matters for documents that are not public yet.

The tools for this job