CSS unit converter
Unit conversionHow many pixels is that in rem?
Convert CSS lengths between px, rem, em, pt, pc, in, cm, mm and Q at your font size.
What you enter stays on your device while you use this tool. Opening a shared link sends the settings in its address to HowToolbox to prepare the page.
Result
16 px
1 rem equals 16 pixels
- The other way round: 1 px = 0.0625 rem.
In all units
- Pixels
- 16 px
- Root ems
- 1 rem
- Ems
- 1 em
- Points
- 12 pt
- Picas
- 1 pc
- Inches
- 0.1667 in
- Centimetres
- 0.4233 cm
- Millimetres
- 4.233 mm
- Quarter-millimetres
- 16.93 Q
Sponsored Links
Convert CSS lengths between px, rem, em, pt, pc, in, cm, mm and Q at your font size.
How to use
- Type the length you want to convert.
- Choose the units to convert from and to.
- Set the font size that 1 rem or 1 em stands for: 16 px unless your stylesheet changes it.
How it works
CSS has absolute lengths, fixed to each other, and font-relative ones. In CSS, an inch is always 96 px, so 1 pt (1/72 in) is 4/3 px, a pica is 16 px and 1 cm is about 37.8 px. These CSS pixels are not the screen's physical pixels; the browser scales them.
A rem is the font size of the root element and an em the font size of the element itself. Browsers default to 16 px, so rem = px ÷ 16 and 24 px = 1.5 rem. If your root font size is 20 px, 24 px is 1.2 rem. The converter uses the one font size you set for both, so for em, give the size that applies to that element.
The definitions come from the W3C CSS Values and Units Module Level 4. Viewport and container units (vw, vh, cqw) depend on the screen and are not included.
Sponsored Links
Frequently asked questions
How many pixels is 1 rem?
16 px at the browsers' default font size. It changes with the root font size, for example 10 px when html { font-size: 62.5% }.
What is the difference between em and rem?
rem always uses the root (html) font size; em uses the font size of the element it is on, so nested ems multiply.
How many pixels is 12 pt?
16 px: a point is 1/72 inch and a CSS inch is 96 px.
Is a CSS pixel always one screen pixel?
No. CSS pixels are reference units. The device pixel ratio and zoom determine how many physical pixels render one CSS pixel.
Can I convert vw or vh here?
No. They depend on the viewport dimensions. This converter supports fixed CSS lengths and em/rem at the font size you supply.
Next you might need
- Aspect ratio calculatorFind the aspect ratio of a width and height, or resize a picture or video to a new width or height without stretching it., private, runs on your deviceMedia and filesCalculator
- Browser infoBrowser, engine and device facts, reported here., private, runs on your deviceWeb & developerChecker
- Paper sizesLook up A, B and C series sizes and US Letter, Legal and Tabloid in millimetres, centimetres, inches or points., private, runs on your deviceUnit conversionReferenceLengthMetricImperial
- Angle converterConvert between degrees, radians, gradians, arcminutes, arcseconds, turns and mils., private, runs on your deviceUnit conversionConverterGeometry
- Area converterConvert between square metres, hectares, acres, square feet, square miles and more, exactly., private, runs on your deviceUnit conversionConverterAreaMetricImperial
- Battery sizesEvery common battery size, from AAA to D, 9 V, CR2032 and LR44 button cells to 18650: dimensions, voltage, IEC names and equivalents., private, runs on your deviceElectronics & cablingReferenceLength
More in Unit conversion
All 24 utilities in Unit conversion- Temperature ConverterCelsius, Fahrenheit, kelvin, Rankine and oven gas marks, exactly., private, runs on your device
- Beaufort wind scaleTurn a wind speed in m/s, km/h, knots or mph into its Beaufort force and name., private, runs on your device
- Cooking converterConvert recipe amounts by ingredient., private, runs on your device
- Data size converterConvert between bytes, kilobytes, megabytes, gigabytes, MiB, GiB and bits, with 1,000 and 1,024 kept apart., private, runs on your device
- Density converterConvert between kg/m³, g/cm³, kg/L, g/L, lb/ft³, lb/in³, oz/in³ and pounds per gallon., private, runs on your device
- Energy converterConvert between joules, kilowatt-hours, kilocalories, BTU and more, using exact definitions., private, runs on your device
Popular now
Sponsored Links
Sponsored Links
Sponsored Links