The CSS pixel is the canonical length unit of Cascading Style Sheets and modern web interface layout. Its symbol is px. Belonging to the W3C CSS layout system rather than describing a single hardware dot, it is defined simultaneously as an optical reference angle and as exactly 1/96 of a CSS inch.
That dual definition solves a problem physical pixels alone could never handle. The W3C defines the reference pixel as the visual angle of one pixel on a 96-dots-per-inch screen held at an arm's length of 28 inches (about 71 centimetres) — roughly 0.0213 degrees. Anchoring layouts to angular size lets a 16-pixel typeface appear broadly comparable on a smartphone held close, a laptop on a desk and a television across a room.
The 96-pixel-per-inch baseline is a piece of computing history. Early Macintosh monitors ran at 72 dots per inch so one screen dot matched one typographical point, whereas Microsoft chose 96 logical dots per inch for Windows in the 1980s to give small letters extra vertical strokes on coarse displays. When CSS 2.1 locked absolute units together, the Windows figure became the universal web constant.
On modern Retina, 4K and smartphone displays, the gap between CSS pixels and physical device pixels is decisive. A screen with a device pixel ratio of two or three paints each CSS pixel across a 2-by-2 or 3-by-3 grid of hardware subpixels, preserving comfortable layout proportions while giving letterforms and icons print-like sharpness.
Everyday web conventions centre on familiar pixel benchmarks. Browsers default body copy to 16 px; accessibility guidelines recommend tap targets of 44 to 48 px; interface icons step through 16, 24, 32 and 48 px; and responsive breakpoints commonly cluster around 768, 1024 and 1280 px.
Because browsers tie every absolute CSS length back to the pixel grid on screen, px remains the shared currency between design tools, front-end code and bitmap imagery.
One CSS pixel equals 0.75 points, 15 twips, 0.0625 picas, 0.0625 CSS rems or ems at the standard 16-pixel browser default, about 0.2646 CSS millimetres, or about 0.01042 CSS inches.
| Unit | Symbol | 1 CSS pixel equals | 1 of these equals | Converter |
|---|---|---|---|---|
| Point | pt | 0.75 pt | 1.33333333333 px | CSS pixels to Points |
| Pica | pc | 0.0625 pc | 16 px | CSS pixels to Picas |
| CSS rem | rem | 0.0625 rem | 16 px | CSS pixels to CSS rems |
| CSS em | em | 0.0625 em | 16 px | CSS pixels to CSS ems |
| Twip | twip | 15 twip | 0.0666666666667 px | CSS pixels to Twips |
| CSS millimeter | mm CSS | 0.264583333333 mm CSS | 3.77952755906 px | CSS pixels to CSS millimeters |
| CSS inch | in CSS | 0.0104166666667 in CSS | 96 px | CSS pixels to CSS inches |