MM to Pixels for CSS

Convert millimeters to CSS pixels for web layouts, print styles, and browser measurements using the 96 DPI CSS reference pixel.

CSS Conversion Input

Real-time sync active
CSS quick values
mm
px

CSS Pixel Result

37.7953 px
10 mm = 37.7953 px @ 96 DPI

Conversion Formula

px = mm × (DPI ÷ 25.4)
px = 10 × (96 ÷ 25.4)
px = 10 × 3.7795
px = 37.7953

CSS declaration value

Centimeters
1 cm
Inches
0.3937 in
Points (pt)
28.3465 pt
CSS rem (16px base)
2.3622 rem

How MM to Pixels for CSS Calculator Works

To convert millimeters to CSS pixels, this calculator uses the W3C CSS reference pixel, which defines 1 inch as exactly 96 pixels. The CSS mm unit and px unit have a fixed mathematical relationship — no physical display DPI is involved.

1

Enter the mm value

Enter a millimeter value. In CSS, <code>mm</code> is an absolute length unit — <code>10mm</code> in a stylesheet always equals a fixed number of CSS pixels, regardless of the device's physical screen density.

2

Fixed at 96 DPI

The DPI is locked at 96 because the W3C CSS specification defines 1 CSS inch as exactly 96 CSS pixels, and 1 CSS inch as exactly 25.4 mm. This creates a fixed conversion ratio.

3

Read the pixel result

Read the pixel result. You can use <code>{result}px</code> in place of <code>{mm}mm</code> in any CSS declaration — <code>width</code>, <code>margin</code>, <code>padding</code>, <code>border-width</code>, etc. — and the browser renders them identically.

CSS absolute units (<code>mm</code>, <code>cm</code>, <code>in</code>, <code>pt</code>, <code>pc</code>, <code>px</code>) are all defined relative to each other, not to the physical display. On high-DPI screens, browsers scale all CSS pixels uniformly via <code>devicePixelRatio</code>. The <code>mm</code> → <code>px</code> conversion stays constant.

MM to Pixels for CSS Formula

The CSS mm to pixels formula is: px = mm × (96 ÷ 25.4), which simplifies to px = mm × 3.7795. This is defined by the W3C CSS Values and Units Module.

px = mm × ( 96 ÷ 25.4 )

This mm to px formula has 2 variables and 1 fixed constant:

  • mm — the CSS millimeter value from your stylesheet
  • 96 — the CSS reference pixel density (1in = 96px per W3C spec)
  • 25.4 — millimeters per inch (1in = 25.4mm per W3C spec)

MM to Pixels for CSS Formula Examples

1 mm in CSS pixels

px = 1 × (96 ÷ 25.4) px = 1 × 3.7795 px = 3.7795

10 mm in CSS pixels

px = 10 × (96 ÷ 25.4) px = 10 × 3.7795 px = 37.7953

1 inch in CSS pixels

px = 25.4 × (96 ÷ 25.4) px = 25.4 × 3.7795 px = 96

The reverse formula is: mm = px × (25.4 ÷ 96), or mm = px × 0.2646. In CSS, 96px = 25.4mm = 1in = 72pt = 6pc = 2.54cm. These relationships are exact and invariant across all browsers.

MM to Pixels for CSS Conversion Chart

Reference table showing the exact CSS px equivalent for common mm values. Since CSS uses a fixed 96 DPI reference, these conversions are absolute and identical in every browser.

mm px @ 72 DPI px @ 96 DPI px @ 150 DPI px @ 300 DPI
0.5 1.4173 1.8898 2.9528 5.9055
1 2.8346 3.7795 5.9055 11.811
2 5.6693 7.5591 11.811 23.622
3 8.5039 11.3386 17.7165 35.4331
5 14.1732 18.8976 29.5276 59.0551
10 28.3465 37.7953 59.0551 118.1102
15 42.5197 56.6929 88.5827 177.1654
20 56.6929 75.5906 118.1102 236.2205
25 70.8661 94.4882 147.6378 295.2756
50 141.7323 188.9764 295.2756 590.5512
100 283.4646 377.9528 590.5512 1181.1024
210 595.2756 793.7008 1240.1575 2480.315
297 841.8898 1122.5197 1753.937 3507.874

In CSS, <code>10mm</code> always equals <code>37.7953px</code>. The 72 DPI column shows equivalent CSS <code>pt</code> values (since 1pt = 1/72in), which is useful when converting between <code>mm</code> and <code>pt</code> units in print stylesheets.