An easy to use px to rem converter tool for web designers.
Font Size = 0.625rem & Base Font Size = 16px
[Sample Text]
Simply enter the px value and the tool will convert it into rem (css unit) instantaneously as you type. No extra clicks required!
Also, this is a two way px ⇄ rem converter tool. So, feel free to enter the rem value in the rem input box to get its px conversion. Alternatively, you can use our dedicated REM to PX converter, which also works both the ways.
And, for your reference this tool also shows you the live text preview of the rem font-size as per the root font size set by you, so you can also test the font-size right on this page using this tool to save your time.
As per default root font size of HTML - 16px.
To do conversions for other px, rem or base values use the tool above.
rem stands for "root em". It's a CSS unit of measurement used for font sizes, as well as for some other properties such as margin and padding. Unlike the pixels (px), which is a fixed size, the rem is relative to the root font size, which is usually the font size set for '<html>' tag.
<style>
html{
font-size: 16px;
}
</style>
In other words, if you set the font size of the root <html> tag to be 16 px (as shown above), then setting a font size of 1 rem on a <p> tag will result in a font size of 16 pixels. If you then change the root font size to 20 px, the font size of that <p> tag of 1 rem will change accordingly to 20 px.
The use of rem provides a way to scale the font size of an entire page based on a single value, which can be especially useful in responsive web design where you want to adjust the font size based on the size of the viewport.
For example, if you set the root font size to 10 px on small screens, and 16 px on large screens, you can use rem throughout your stylesheet to ensure that the font sizes of all other elements adjust accordingly.
The formula for REM is:
rem = px / base font-size of root <html> tag
Let's say you want to calculate rem value of 16px, then as per the formula above, you've to divide 16 with the base font-size.
If the base font-size is 16px, then 16 divided by 16 is 1.
Hence, 16px is equals to 1rem.
This PX to REM converter tool does calculations using the same formula and allows you to convert px to rem in much fast and easy way than doing this calculation manually.