PX to REM converter
Convert any CSS length for free with your own root font size and viewport, or paste a stylesheet to replace its px values with rem.
Free, no sign-up, no limit Runs in your browser: your text and files are never sent or saved.
PX to REM converter
Your CSS stays in your browser: nothing is sent.
Convert a value
Results
Enter a value to see it in every unit.
Convert a CSS block
Paste CSS to convert its px values to rem.
px to rem table (1 to 96 px)
| px | rem | pt | % of parent |
|---|---|---|---|
| 1px | 0.0625rem | 0.75pt | 6.25% |
| 2px | 0.125rem | 1.5pt | 12.5% |
| 3px | 0.1875rem | 2.25pt | 18.75% |
| 4px | 0.25rem | 3pt | 25% |
| 5px | 0.3125rem | 3.75pt | 31.25% |
| 6px | 0.375rem | 4.5pt | 37.5% |
| 7px | 0.4375rem | 5.25pt | 43.75% |
| 8px | 0.5rem | 6pt | 50% |
| 9px | 0.5625rem | 6.75pt | 56.25% |
| 10px | 0.625rem | 7.5pt | 62.5% |
| 11px | 0.6875rem | 8.25pt | 68.75% |
| 12px | 0.75rem | 9pt | 75% |
| 13px | 0.8125rem | 9.75pt | 81.25% |
| 14px | 0.875rem | 10.5pt | 87.5% |
| 15px | 0.9375rem | 11.25pt | 93.75% |
| 16px | 1rem | 12pt | 100% |
| 17px | 1.0625rem | 12.75pt | 106.25% |
| 18px | 1.125rem | 13.5pt | 112.5% |
| 19px | 1.1875rem | 14.25pt | 118.75% |
| 20px | 1.25rem | 15pt | 125% |
| 21px | 1.3125rem | 15.75pt | 131.25% |
| 22px | 1.375rem | 16.5pt | 137.5% |
| 23px | 1.4375rem | 17.25pt | 143.75% |
| 24px | 1.5rem | 18pt | 150% |
| 25px | 1.5625rem | 18.75pt | 156.25% |
| 26px | 1.625rem | 19.5pt | 162.5% |
| 27px | 1.6875rem | 20.25pt | 168.75% |
| 28px | 1.75rem | 21pt | 175% |
| 29px | 1.8125rem | 21.75pt | 181.25% |
| 30px | 1.875rem | 22.5pt | 187.5% |
| 31px | 1.9375rem | 23.25pt | 193.75% |
| 32px | 2rem | 24pt | 200% |
| 33px | 2.0625rem | 24.75pt | 206.25% |
| 34px | 2.125rem | 25.5pt | 212.5% |
| 35px | 2.1875rem | 26.25pt | 218.75% |
| 36px | 2.25rem | 27pt | 225% |
| 37px | 2.3125rem | 27.75pt | 231.25% |
| 38px | 2.375rem | 28.5pt | 237.5% |
| 39px | 2.4375rem | 29.25pt | 243.75% |
| 40px | 2.5rem | 30pt | 250% |
| 41px | 2.5625rem | 30.75pt | 256.25% |
| 42px | 2.625rem | 31.5pt | 262.5% |
| 43px | 2.6875rem | 32.25pt | 268.75% |
| 44px | 2.75rem | 33pt | 275% |
| 45px | 2.8125rem | 33.75pt | 281.25% |
| 46px | 2.875rem | 34.5pt | 287.5% |
| 47px | 2.9375rem | 35.25pt | 293.75% |
| 48px | 3rem | 36pt | 300% |
| 49px | 3.0625rem | 36.75pt | 306.25% |
| 50px | 3.125rem | 37.5pt | 312.5% |
| 51px | 3.1875rem | 38.25pt | 318.75% |
| 52px | 3.25rem | 39pt | 325% |
| 53px | 3.3125rem | 39.75pt | 331.25% |
| 54px | 3.375rem | 40.5pt | 337.5% |
| 55px | 3.4375rem | 41.25pt | 343.75% |
| 56px | 3.5rem | 42pt | 350% |
| 57px | 3.5625rem | 42.75pt | 356.25% |
| 58px | 3.625rem | 43.5pt | 362.5% |
| 59px | 3.6875rem | 44.25pt | 368.75% |
| 60px | 3.75rem | 45pt | 375% |
| 61px | 3.8125rem | 45.75pt | 381.25% |
| 62px | 3.875rem | 46.5pt | 387.5% |
| 63px | 3.9375rem | 47.25pt | 393.75% |
| 64px | 4rem | 48pt | 400% |
| 65px | 4.0625rem | 48.75pt | 406.25% |
| 66px | 4.125rem | 49.5pt | 412.5% |
| 67px | 4.1875rem | 50.25pt | 418.75% |
| 68px | 4.25rem | 51pt | 425% |
| 69px | 4.3125rem | 51.75pt | 431.25% |
| 70px | 4.375rem | 52.5pt | 437.5% |
| 71px | 4.4375rem | 53.25pt | 443.75% |
| 72px | 4.5rem | 54pt | 450% |
| 73px | 4.5625rem | 54.75pt | 456.25% |
| 74px | 4.625rem | 55.5pt | 462.5% |
| 75px | 4.6875rem | 56.25pt | 468.75% |
| 76px | 4.75rem | 57pt | 475% |
| 77px | 4.8125rem | 57.75pt | 481.25% |
| 78px | 4.875rem | 58.5pt | 487.5% |
| 79px | 4.9375rem | 59.25pt | 493.75% |
| 80px | 5rem | 60pt | 500% |
| 81px | 5.0625rem | 60.75pt | 506.25% |
| 82px | 5.125rem | 61.5pt | 512.5% |
| 83px | 5.1875rem | 62.25pt | 518.75% |
| 84px | 5.25rem | 63pt | 525% |
| 85px | 5.3125rem | 63.75pt | 531.25% |
| 86px | 5.375rem | 64.5pt | 537.5% |
| 87px | 5.4375rem | 65.25pt | 543.75% |
| 88px | 5.5rem | 66pt | 550% |
| 89px | 5.5625rem | 66.75pt | 556.25% |
| 90px | 5.625rem | 67.5pt | 562.5% |
| 91px | 5.6875rem | 68.25pt | 568.75% |
| 92px | 5.75rem | 69pt | 575% |
| 93px | 5.8125rem | 69.75pt | 581.25% |
| 94px | 5.875rem | 70.5pt | 587.5% |
| 95px | 5.9375rem | 71.25pt | 593.75% |
| 96px | 6rem | 72pt | 600% |
How to use it
- Type a value and pick its unit: it is shown at once in px, rem, em, %, pt, vw and vh.
- Adjust the root font size (16 px in every browser by default), the parent font size and the viewport if needed.
- To convert a stylesheet, paste it in the CSS block area, choose the direction (px to rem or rem to px) and the precision, then copy the result.
Example
Input
padding: 12px 24px; (root font size 16 px)
Output
padding: 0.75rem 1.5rem;
Good to know
- em and % depend on the parent element’s font size, which is set here by hand: the browser may compute a different one.
- vw and vh use the viewport size you enter; on a real screen, scrollbars and mobile toolbars change it.
- The CSS block conversion leaves comments, strings, url() and, by default, media query conditions untouched; values inside JavaScript or HTML are not handled.
- Everything runs in your browser: your CSS is not sent to any server.
Frequently asked questions
How do I convert px to rem?
Divide the pixels by the root font size, 16 px by default: 24 px ÷ 16 = 1.5rem. Common values: 12 px = 0.75rem, 14 px = 0.875rem, 16 px = 1rem, 18 px = 1.125rem, 20 px = 1.25rem, 32 px = 2rem. The table on this page lists 1 to 96 px.
How many pixels is 1rem?
1rem equals the font size of the html element: 16 px in every browser unless your CSS or the user’s settings change it. Some sites set html { font-size: 62.5% } so that 1rem = 10 px; enter 10 as the root font size to convert for them.
What is the difference between rem and em?
rem is relative to the root (html) font size, so it means the same everywhere on the page. em is relative to the font size of the parent element, so it compounds when elements are nested: 1.2em inside 1.2em gives 1.44 times the base size.
Should I use px or rem for font sizes?
rem is usually better for text: if a reader raises the default font size in the browser settings, rem sizes grow with it, while px sizes stay fixed. Keep px for things that should not scale, such as 1 px borders, which the CSS block conversion leaves in px by default.
How do I convert a whole CSS file from px to rem?
Paste it in “Convert a CSS block”: every px value becomes rem with up to 4 decimals (adjustable from 0 to 6). Values of 1 px or less, comments, strings, url() and media query conditions stay in px by default, and the tool counts what it converted and kept.
How do I convert px to pt or vw?
In CSS, 1 pt = 4/3 px, so pt = px × 0.75: 16 px = 12 pt. For vw, divide by the viewport width and multiply by 100: 24 px on a 1,920 px wide screen = 1.25vw. Type your own viewport size in the settings to get exact values.