24px is 1.5rem at a 16px root font size
Converting CSS units means turning every value into px first, then dividing by the number of px in one target unit. When the root (html) font size is the browser default of 16px, 1rem = 16px, so 24px is 24 ÷ 16 = 1.5rem. On a 1440×900 viewport the same 24px is 1.6667vw and 2.6667vh, and in print units it is 18pt and 6.35mm.
The tricky units are the relative ones: rem, em, % and vw. Change the basis and the same number becomes a different size. The converter above lets you set the root font size, the em base font size and the viewport width and height, then shows all 16 units at once. The "Same size, different screens" bars take the current size written as px, rem and vw and show how many px each one gives when the user raises the browser font size or the screen width changes.
When and why to convert units
- Moving a design from px to code: design tools usually list sizes in px. If you write font sizes and spacing in rem, the whole layout grows by the same ratio when a user raises the browser's default font size.
- Supporting users who enlarge text: Chrome's font size setting offers preset choices of 9, 12, 16, 20 and 24px, and the chosen value becomes the browser default. If the html font size is not fixed in px, 1.5rem becomes 30px at the 20px setting and 36px at the 24px setting, while text written as 24px stays the same. MDN also notes that setting font sizes in px prevents users of some browsers from changing the size.
- Scaling with the screen width: a large heading or full-screen banner written in vw follows the viewport width. 24px on a 1440px screen is 1.6667vw, which gives 6.5px on a 390px phone and 32px on a 1920px monitor.
- Matching print CSS or document sizes: in print stylesheets you can keep pt, mm and cm as they are. To make 12pt text from a word processor look the same on screen, convert it to 16px.
How the calculation works
- Convert the input to px: input × (px in one of that unit). 1.5rem is 1.5 × 16 = 24px, and 5vw is 5 × 1440 ÷ 100 = 72px.
- Divide by the target unit: px ÷ (px in one target unit). 24px in pt is 24 ÷ (4/3) = 18pt.
- Use fractions and round only at the end: definitions such as 1pt = 4/3px and 1cm = 4800/127px are kept as fractions, multiplied through, then rounded to four decimal places. That is why 24px → 18pt never shows up as 18.000000000000004.
| Unit | Basis | 1 unit (default settings) |
|---|---|---|
| rem | Font size of the root (html) element | 16px |
| em | The element's own font size; in font-size, the parent's font size | 16px |
| % | Depends on the property; in font-size, the parent's font size | 0.16px |
| vw · vh | 1% of the viewport width · height | 14.4px · 9px |
| vmin · vmax | 1% of the smaller · larger of width and height | 9px · 14.4px |
| in · cm · mm · Q | 1in = 2.54cm, 1cm = 10mm = 40Q | 96 · 37.7953 · 3.7795 · 0.9449px |
| pt · pc | 1pt = 1/72in, 1pc = 1/6in = 12pt | 1.3333 · 16px |
| ch · ex | Width of the digit 0 · height of a lowercase x in that font | varies by font |
Default settings are a 16px root font size and a 1440×900px viewport. The absolute length relationships follow the definitions in W3C CSS Values and Units Level 4 (Working Draft, 2024-03-12), checked against the source on 2026-10-12.
px ↔ rem conversion table
The table lists a 16px root next to a 10px root, which is what you get with html { font-size: 62.5% }. For any other root size, change the root in "Common values" in the converter above and the table recalculates.
| px | 16px root | 10px root |
|---|---|---|
| 10px | 0.625rem | 1rem |
| 12px | 0.75rem | 1.2rem |
| 13px | 0.8125rem | 1.3rem |
| 14px | 0.875rem | 1.4rem |
| 15px | 0.9375rem | 1.5rem |
| 16px | 1rem | 1.6rem |
| 18px | 1.125rem | 1.8rem |
| 20px | 1.25rem | 2rem |
| 24px | 1.5rem | 2.4rem |
| 28px | 1.75rem | 2.8rem |
| 32px | 2rem | 3.2rem |
| 40px | 2.5rem | 4rem |
| 48px | 3rem | 4.8rem |
| 64px | 4rem | 6.4rem |
The same 24px, different real sizes by unit
px stays put when user settings or the screen width change. rem follows the browser's default font size, and vw follows the screen width. If the current 24px is written in each of the three units, the real size in each situation is below (assuming the root font size is not set on html, or is set in %).
| Situation | Written as 24px | Written as 1.5rem | Written as 1.6667vw |
|---|---|---|---|
| Current settings (16px default font, 1440px wide) | 24px | 24px | 24px |
| Browser default font 20px | 24px | 30px | 24px |
| Browser default font 24px | 24px | 36px | 24px |
| 390px wide screen | 24px | 24px | 6.5px |
| 1920px wide screen | 24px | 24px | 32px |
Browser zoom behaves differently from this table. Zoom enlarges sizes written in px and rem, but the viewport width measured in CSS px shrinks by the same factor, so sizes written in vw stay the same. A user who changes only the font size setting sees only rem and em sizes grow. A common pattern is rem for body text and, for large decorative headings that should follow the screen width, vw inside clamp() with a rem minimum and maximum. You can build the clamp() expression with the CSS clamp() generator on this site.
pt is read differently by different programs
In CSS, 1in = 72pt = 96px, so 1pt = 4/3px. Microsoft Word also counts 1 inch as 72 points, so a Word font size carries over to the web as shown below.
| Word font size | CSS px | rem at a 16px root |
|---|---|---|
| 8pt | 10.6667px | 0.6667rem |
| 9pt | 12px | 0.75rem |
| 10pt | 13.3333px | 0.8333rem |
| 10.5pt | 14px | 0.875rem |
| 11pt | 14.6667px | 0.9167rem |
| 12pt | 16px | 1rem |
| 14pt | 18.6667px | 1.1667rem |
| 16pt | 21.3333px | 1.3333rem |
| 18pt | 24px | 1.5rem |
| 24pt | 32px | 2rem |
- pt in Photoshop mockups: Photoshop's help describes a PostScript point as 1/72 inch in a 72ppi image. In a 72ppi document one inch is 72 pixels, so 24pt text is 24 pixels and becomes 24px on the web. Writing 24pt in CSS would give 32px, larger than the mockup. Photoshop can also switch to the traditional 72.27 points per inch, so check its preferences.
- Android dp and sp: Android's documentation defines 1dp as one pixel on a 160dpi screen, a virtual unit. Because it keeps sizes consistent across device densities, it is used much like CSS px. The text unit sp scales with the user's font size setting, which makes it similar to rem.
- CSS px and device pixels: one CSS px is not one physical screen pixel. On high-density screens a CSS px is drawn with two or three physical pixels, so copying the pixel dimensions of a mockup image straight into CSS px can make things two or three times too large.
% and em depend on the property
The % in the converter is relative to font-size. The same 150% refers to a different value depending on the property, so a % meant for width or spacing has to be calculated separately.
| Property | What % refers to | 150% example |
|---|---|---|
| font-size | Parent element's font size | 16px parent → 24px |
| line-height | The element's own font size | 16px text → 24px line height |
| width · padding · margin | Width of the containing block (usually the parent). padding-top and margin-top also use the width | 400px parent width → 600px |
| height | Height of the containing block. Treated as auto if the parent's height depends on its content | 200px parent height → 300px |
In font-size, em refers to the parent element's font size; in other properties it refers to the element's own font size. That is why em font sizes multiply as they nest. In MDN's example, with a 16px default, 1.6em inside another 1.6em gives 25.6px for the outer element and 40.96px for the inner one. In the converter's "em/% base font size" field, enter the parent's font size when you calculate font-size, and the element's own font size when you calculate another property such as padding. A unitless line-height (for example 1.5) is recalculated by each child from its own font size, so it is easier to predict than % or em.
vw, vh and the mobile address bar
- vh assumes the address bar is collapsed: CSS Values 4 defines the default vw and vh as 1% of the large viewport. The large viewport is measured as if dynamic browser UI such as the address bar were retracted, so while the bar is showing, the bottom of a 100vh box can fall off the screen.
- svh, lvh and dvh: svh is 1% of the small viewport (UI expanded), lvh of the large viewport (UI retracted), and dvh of the dynamic viewport, which follows the current state. A box that fills the first screen is safer at 100svh or 100dvh, so the address bar does not cover it. These units are calculated the same way as vh, so enter the viewport height for that state in the converter's height field.
- Do not size text in vw alone: WCAG requires that text can be resized up to 200% without assistive technology (1.4.4, AA). Viewport units do not grow with zoom or font size settings, so sizing text mainly in vw is likely to match failure F94.
Common mistakes
- Calculating rem without checking the root font size: if the project uses html { font-size: 62.5% }, 1rem is 10px, not 16px. The same 24px is 2.4rem, not 1.5rem.
- Fixing the html font size in px: with html { font-size: 10px }, the root is cut off from the browser's default font size, so rem no longer follows user settings either. Use a percentage such as 62.5% so the user's setting still applies.
- Using a font-size % for width: 150% is 1.5 times the parent's font size in font-size, but 1.5 times the parent's width in width.
- Treating CSS pt as the mockup's pt: 24pt in a 72ppi Photoshop mockup is 24px on the web. Writing 24pt in CSS gives 32px, larger than the mockup.
- Nesting em: when the same class stacks, as in a list inside a list, em font sizes multiply and keep growing or shrinking. rem is easier to predict there.
- Checking a vw result on one screen only: 1.6667vw is 24px at 1440px but only 6.5px at 390px, which is too small to read. Use the phone and monitor chips to see both ends.
Limits and cautions
- rem is calculated from the single root font size you enter. If a real site changes the html font size with media queries, enter that value and calculate again.
- The rem bar in "Same size, different screens" covers sites whose html font size is unset or set in % or rem, so it follows the browser's default font size. If the html font size is fixed in px, rem does not grow either.
- em and % are calculated from the one "em/% base font size" value. On a real page, each element may inherit a different font size.
- A real browser viewport can differ from the width and height you enter because of scrollbars and the address bar. The "This window" chip fills in this window's window.innerWidth and innerHeight.
- ch and ex are measured in the default sans-serif font of the browser you are using. A site with a different font gets different values. When measuring is not possible, the specification's fallback of 0.5em is used.
- Nothing guarantees that absolute units such as cm, mm and in match a real ruler on screen, because CSS fixes 1in = 96px and the device decides how large a px is.
- Results are rounded to four decimal places. Values smaller than 0.0001 are shown with three significant digits.
Sources
- 01W3C — CSS Values and Units Module Level 4Working Draft, 2024-03-12. 1in = 2.54cm = 96px, 1pt = 1/72in, 1pc = 1/6in, 1Q = 1/40cm, definitions of em, rem, ex and ch with the 0.5em fallback for ex and ch, vw and vh as 1% of the large viewport, svh, lvh, dvh. Checked 2026-10-12
- 02MDN — font-sizeDefault browser font size is usually 16px, em and % relative to the parent's font size, em nesting (25.6px → 40.96px), rem relative to the root, px font sizes cannot be changed by users in some browsers
- 03MDN — padding% is relative to the inline size of the containing block (the width in horizontal writing)
- 04MDN — line-height% is relative to the element's own font size; a unitless number is recommended
- 05MDN — height% is relative to the height of the containing block; auto if that height depends on content
- 06W3C WAI — Understanding SC 1.4.4 Resize TextText can be resized up to 200% without assistive technology (AA)
- 07W3C WAI — F94: Failure of SC 1.4.4 due to text sized in viewport unitsViewport units do not scale with zoom or font size settings
- 08Chromium — appearance_page.tsFont size choices in fontSizeOptions_: 9, 12, 16, 20, 24 (default font size in px); English UI names Very small, Small, Medium, Large, Very large
- 09Adobe Photoshop help — Formatting charactersPostScript point = 1/72 inch in a 72ppi image; traditional 72.27 points per inch
- 10Android Developers — Support different pixel densities1dp ≈ one pixel on a 160dpi screen; sp follows the user's font size setting
- 11Microsoft Learn — Application.PointsToInches (Word)Point conversion in Word: 1 inch = 72 points
Frequently asked questions
How many rem is 24px?
If the root (html) font size is the browser default of 16px, 24 ÷ 16 = 1.5rem. With a 10px root (html { font-size: 62.5% }) it is 2.4rem, and with a 14px root about 1.7143rem. rem is the value divided by the root font size, so check your project's html font size first.
What is the difference between rem and em?
rem is relative to the font size of the document's root (html) element, and em to the font size of the element itself. When em is used in font-size, the parent element's font size is the basis. That is why em values multiply as they nest (1.6em inside 1.6em is 2.56 times), while rem stays the same wherever it appears.
Should I set font sizes in px or rem?
If you want to support users who raise the browser's default font size, rem is the better choice. Chrome's font size setting offers preset choices of 9, 12, 16, 20 and 24px, and unless the html font size is fixed in px, 1.5rem grows to 30px at the 20px setting and 36px at the 24px setting, while 24px stays the same. MDN also notes that setting font sizes in px prevents users of some browsers from changing the size.
Why is html { font-size: 62.5% } used?
62.5% of the browser default of 16px is 10px, so rem math gets easy: 1.6rem = 16px. Because it is a percentage, a user who raises the default font to 20px also gets a 12.5px root. The catch is that you must set body text again to values like 1.6rem, and third-party libraries that assume a 16px root may end up looking smaller.
How many px is 1pt?
CSS defines 1in = 72pt = 96px, so 1pt = 4/3px, about 1.3333px. A 12pt font from a word processor is 16px on the web, and 10pt is about 13.3333px. Photoshop's help describes a point as 1/72 inch in a 72ppi image; at 72ppi one inch is 72 pixels, so 24pt text in that document is 24 pixels and becomes 24px on the web. Writing 24pt in CSS gives 32px.
Does a value converted to vw look different on different screens?
Yes. 1vw is 1% of the viewport width, so the same 1.6667vw is 24px on a 1440px screen, 6.5px on a 390px screen and 32px on a 1920px screen. The "Same size, different screens" bars show this difference directly. Sizing text in vw alone cannot be enlarged by zoom or font size settings, so it is likely to count as a WCAG 1.4.4 failure (F94).
Can I use a converted % value for width?
The % in this converter is relative to font-size (1% of the base font size). The % in width, padding and margin is relative to the width of the parent element (the containing block), so the same 150% gives a completely different size. The % in padding-top also uses the width, not the height. Calculate a width % separately as the desired px ÷ the parent's width × 100. For 300px inside a 400px parent, that is 75%.
Why are the ch and ex values approximate?
1ch is the width of the digit 0 and 1ex is the height of a lowercase x in a given font, so both vary by font. This converter measures 0 and x in the default sans-serif font of the browser you are using. When measuring is not possible, it uses the 0.5em fallback defined by the CSS specification. On a real site with a different font, the values can differ.