Skip to main content

Convert pixels to cm (and cm to pixels)

Convert pixels to centimetres and centimetres to pixels at a given resolution (DPI/PPI), and read the resolution and print size of a PNG or JPEG image locally.

Embed this widget

Customize the result, check the live preview, then copy the code.

Preview

Embed code type

Code to copy

Responsive and automatically resized by Bethemesh.

Resolution

300 for quality printing, 150 for everyday prints, 96 for the CSS screen reference, 72 for legacy uses.

Common values

Pixels and centimetres

Print size of an image

Optional. The image is read in your browser and never uploaded. The resolution is read from PNG and JPEG files.

Was this tool useful?

How does this tool work?

A pixel has no fixed size: its physical dimension depends on the resolution, expressed in DPI or PPI (dots or pixels per inch). Converting pixels to centimetres therefore always requires a resolution. This tool converts both ways, offers the most common values (72, 96, 150 and 300 DPI) and can read an image to show its dimensions, the resolution stored in the file and its print size.

One inch is exactly 2.54 cm. At 300 DPI, an inch holds 300 pixels, so one pixel measures 2.54 ÷ 300 ≈ 0.0085 cm.

To go from pixels to centimetres, the tool multiplies the pixel count by 2.54 and divides by the resolution. For the reverse, it multiplies the centimetres by the resolution and divides by 2.54.

Changing the resolution immediately recalculates the centimetres from the pixels entered: an image keeps the same number of pixels, only its physical size changes.

If you add an image, the tool reads its pixel dimensions and, for a PNG or JPEG, the resolution stored in its metadata (PNG pHYs chunk, JPEG JFIF header or Exif data). The image never leaves your browser.

How to use this tool

  1. Choose the resolution

    Enter a DPI value or click a common one: 300 for printing, 96 for screens in CSS.

  2. Enter a measurement

    Type pixels to get centimetres, or centimetres to get pixels.

  3. Analyse an image if needed

    Add an image to see its dimensions, stored resolution and print size.

Converting between pixels and centimetres

Pixels to centimetres

centimetres = pixels × 2.54 ÷ DPI

Centimetres to pixels

pixels = centimetres × DPI ÷ 2.54

N px
number of pixels
L cm
length in centimetres
R
resolution in dots or pixels per inch (DPI/PPI)
2.54
centimetres in one inch (exact value)

In CSS, the reference resolution is 96 pixels per inch: a CSS pixel measures about 0.026 cm.

Use cases

Prepare a file for printing

Check that a 2,480 × 3,508 px image is enough for an A4 page at 300 DPI, or work out how many pixels a poster needs.

Build a web layout

Turn a measurement in centimetres into CSS pixels, knowing that in CSS one inch equals 96 pixels.

Understand the size shown by software

Find out why the same photo appears 67 cm wide in one program and 16 cm in another: only the stored resolution differs.

Examples

Width of a Full HD screen printed

1920 × 2.54 ÷ 300 = 16.256 cm. The same width is 50.8 cm at 96 DPI.

Input

Resolution: 300 DPI; Pixels: 1920

Result

1,920 px = 16.26 cm = 6.4 in at 300 DPI

Pixels needed for an A4 page

In practice this is rounded to 2,480 × 3,508 px for an A4 page printed at photo quality.

Input

Resolution: 300 DPI; Centimetres: 21 then 29.7

Result

2,480.31 px wide and 3,507.87 px high

Short length in centimetres

10 × 300 ÷ 2.54 = 1,181.1 px.

Input

Resolution: 300 DPI; Centimetres: 10

Result

1,181.1 px = 10 cm = 3.937 in at 300 DPI

Tips and best practices

  • For printing, aim for 300 DPI at the final size; below 150 DPI, details become visible up close.
  • Changing the resolution stored in a file adds no detail: it changes the print size, not the number of pixels.
  • Many cameras and programs store 72 DPI by default: that figure says nothing about the actual image quality.
  • A screen shows pixels at its own density: the centimetres calculated here apply to printing and CSS, not to the real size on a given screen.

Sources and references

Frequently asked questions

How many pixels are in 1 cm?

It depends on the resolution: 1 cm is 118.11 pixels at 300 DPI, 37.8 pixels at 96 DPI and 28.35 pixels at 72 DPI. The formula is pixels = centimetres × DPI ÷ 2.54.

What is the difference between DPI and PPI?

PPI (pixels per inch) describes the density of an image or screen, DPI (dots per inch) that of a printer. In software and files, both terms often mean the same value: the number of image pixels per printed inch.

Why 96 DPI for the web?

The CSS specification sets one inch to 96 CSS pixels. A CSS pixel therefore measures 2.54 ÷ 96 ≈ 0.026 cm, whatever the real density of the screen.

My image is 72 DPI, is it low quality?

Not necessarily. Quality depends on the number of pixels. A 6,000 × 4,000 px photo stored at 72 DPI prints perfectly at 50 × 34 cm at 300 DPI.

Why is the file resolution “not stored”?

Some images contain no resolution information, or only a width/height ratio. Choose the print resolution you want: the calculated size depends entirely on it.

Is my image uploaded to a server?

No. The dimensions and resolution are read in your browser from the first bytes of the file. Nothing is transmitted or kept.

Related tools

Tools similar or complementary to this one.

Similar tools

Resize an image by setting its exact width and height before downloading the result.

Images & graphicsFeaturedUse this tool

Draw a frame on the image, lock a ratio (1:1, 4:5, 16:9…) and download the cropped part.

Images & graphicsFeaturedUse this tool
GuideBest practicesBeginner

Convert a PDF to images or images to PDF

Learn what changes when PDF pages are rasterized, how resolution and image format affect quality, and when to assemble images into a PDF.

29 August 20262 min
GuideConcepts and technologiesBeginner

What Image Resolution Should You Choose?

Distinguish pixel dimensions, pixel density, and DPI so you can resize images for the Web or print without unnecessary loss of sharpness.

31 August 202616 min
GuideBest practicesBeginner

Image Metadata: Read It, Keep It, or Remove It?

Understand EXIF, GPS, XMP, IPTC, ICC profiles, rights information, and how to manage image metadata for privacy, publishing, and Web performance.

31 August 202613 min
TutorialBest practicesBeginner

Optimize images for the Web without losing quality

Resize, compress and choose between WebP, AVIF and other formats with a practical workflow that reduces file size without unnecessary visual loss.

30 August 20264 min