Skip to content

How to read an image’s pixel size, density and print size

The page opens one image in the browser and reports what the file itself declares: pixel dimensions, the reduced aspect ratio, the megapixel count, the file size and, when the file carries one, the embedded pixel density. Nothing is uploaded and the image is never converted — the preview is a canvas copy.

Print size is a calculation on top of those numbers: pixel dimensions divided by a target DPI, shown in inches and centimetres. Change the target and the physical size changes while the pixel count stays the same.

  1. Drop an image on the picker or choose a file — PNG, JPEG, WebP and SVG are accepted, one file at a time.
  2. Set the target DPI if you print at a density other than the 300 that is filled in by default.
  3. Press Inspect image. The dimensions, ratio, megapixels and the details table fill in, and the preview shows the decoded picture.
  4. Press Download JSON to keep the report, or Clear to empty the panel before the next file.

What each value means and what the JSON export contains

Reading the four metrics

Dimensions are the decoded pixel width and height. Aspect ratio divides those two numbers by their greatest common divisor, so 3000 × 2000 is reported as 3:2 while 1366 × 768 becomes 683:384 because nothing smaller divides both. Megapixels are width × height ÷ 1,000,000 with three decimals, and Input size is the file size in the browser’s byte units. The decimal ratio in the table is width ÷ height with six decimals.

Embedded density versus print size

Embedded DPI is metadata a file may or may not carry: a PNG needs a pHYs chunk, a JPEG a JFIF header or an EXIF resolution tag, and the report names the source it read — PNG pHYs, JPEG JFIF or EXIF. When the tag is absent the row reads Not embedded, which does not mean the image is broken: screenshots and exported canvases routinely store pixels without any physical size.

Print size always comes from the target DPI, not from the embedded value. At 300 DPI a 3000 × 2000 image covers 10 × 6.67 in (25.4 × 16.93 cm); set the target to 150 DPI and the same pixels cover twice the width and height. Editing the DPI field does not refresh the table on its own — press Inspect image again after changing it.

The preview and the JSON export

The preview canvas is capped at 1200 px wide, so a 3000 × 2000 photo is drawn at 1200 × 800 while the metrics and print size keep the full pixel numbers. The JSON export holds one object: name, MIME type, byte size, width, height, the reduced and decimal ratios, megapixels, embeddedDensity (or null) and printAtDpi with the dpi, inches and centimetres. Density is read-only metadata — the tool never rewrites the file, and choosing a target DPI does not add a tag to it.

Frequently asked questions

Why does the print size change when I edit the target DPI?

Because print size is pixels ÷ DPI: 3000 px at 300 DPI is 10 in wide, at 150 DPI it is 20 in. The pixel dimensions and the file itself do not change. Press Inspect image after editing the field — the table is recalculated on the run, not while you type.

My image says “Not embedded”. Where did the DPI go?

It was probably never written. Many editors and every screenshot tool save pixels without a physical size, and the tag only exists when the file carries a pHYs, JFIF or EXIF density. The pixel numbers are still exact; only the physical size is a convention, so set the target DPI you actually print at.

Does the tool change or re-encode my image?

No. It reads the header bytes for the density, decodes a copy for the preview and leaves the original untouched; the only file it writes is the JSON report you ask for. The bytes never leave the browser, which is why the page keeps working offline.

Why is the preview smaller than my image?

The preview canvas is capped at 1200 px wide to keep large photos responsive, so a 3000 × 2000 image is displayed at 1200 × 800. The reported dimensions, ratio and print size always use the full pixel dimensions.

Which formats and density tags are supported?

PNG, JPEG, WebP and SVG files open in the preview. Density metadata is read from a PNG pHYs chunk, a JPEG JFIF header and EXIF resolution tags; a WebP or SVG without such a tag simply reports Not embedded.

Recent tools: