CSS length unit convert tool online that supports the conversion of values between CSS units such as px, pt, pc, in, mm, cm, Q, em, rem, vw, vh and other units.
The online CSS length unit conversion tool supports mutual conversion between absolute and relative length units of CSS. The units that support mutual conversion include: px,%, cm, mm, Q, in, pc, pt, em, rem, ex, lh, rlh, ch, vw, vh, vmin, vmax, etc.
- PPI : Pixels Per Inch, it represents the number of pixels owned per inch. Therefore, the higher the PPI value, the higher the density at which the display screen can display images.
- DPI : Dots Per Inch, referring to the number of dots contained in each inch of length.
- CSS absolute length units : they are not relative to anything else, and are generally considered to always be the same size.
- CSS relative length units : Relative length units are relative to something else, perhaps the size of the parent element's font, or the size of the viewport. The benefit of using relative units is that with some careful planning you can make it so the size of text or other elements scales relative to everything else on the page.
List of common length units in CSS
Type Unit Name Description Absolute cm Centimeters Pixel conversion based on PPI mm Millimeters Pixel conversion based on PPI Q Quarter-millimeters Pixel conversion based on PPI in Inches Pixel conversion based on PPI pc Picas 1pc = 12 pt pt Points Inch conversion based on DPI and then pixel conversion using PPI px Pixels It can be converted to inch based on PPI. In the screen with PPI=96, 1in=96px Relative % Percentage Size relative to parent element em em Font size of the parent, in the case of typographical properties like font-size, and font size of the element itself, in the case of other properties like width. ex ex x-height of the element's font. ch ch The advance measure (width) of the glyph "0" of the element's font. rem rem Font size of the root element. lh lh Line height of the element. rlh rlh Line height of the root element. When used on the font-size or line-height properties of the root element, it refers to the properties' initial value. vw vw 1% of the viewport's width. vh vh 1% of the viewport's height. vmin vmin 1% of the viewport's smaller dimension. vmax vmax 1% of the viewport's larger dimension.