Several values at once
Input
24px
14px
1.5remOutput
24px → 1.5rem
14px → 0.875rem
1.5rem → 1.5remAgainst a 16px base. Each line keeps its own unit if one is given.
Browsers default to 16.
Converting px to rem is the routine arithmetic of responsive CSS, and the reason to do it is accessibility: a rem value scales with the user's chosen base font size, while a px value ignores it entirely. Someone who has increased their default font size gets larger text with rem and unchanged text with px.
Paste as many values as you like, one per line, and each is converted with the arithmetic shown alongside it, so you can check the result rather than trust it. The base font size is configurable because the 16px default only holds until a stylesheet changes it, and if it has been changed, every conversion that assumed 16 is wrong.
Each example below is executed against this tool by the test suite, so what you see is what the tool actually produces.
Input
24px
14px
1.5remOutput
24px → 1.5rem
14px → 0.875rem
1.5rem → 1.5remAgainst a 16px base. Each line keeps its own unit if one is given.
The details that decide whether a conversion is correct, and where information can be lost without any error being raised.