Skip to content

PX to REM Converter

Convert pixels to rem using any root font size. Paste a list of values or a whole stylesheet to convert every px value.

Runs in your browserCSS / px → CSS / rem
Loading tool…

Example

Input
.card {
  padding: 24px 12px;
  font-size: 18px;
  border: 1px solid #ddd;
}
Output
.card {
  padding: 1.5rem 0.75rem;
  font-size: 1.125rem;
  border: 0.0625rem solid #ddd;
}

How to use the PX to REM Converter

  1. Paste or type your CSS / px into the input area, or open a file from your device.
  2. Adjust the options above the editor if the tool offers any.
  3. Review the CSS / rem result, then copy it or download it as a file.

Privacy and limitations

  • Your data is processed on your device and is not uploaded to any server.

Frequently asked questions

How is rem calculated?

rem = px ÷ root font size. With the browser default of 16px, 24px is 1.5rem.

Should borders be converted too?

Hairline 1px borders are often kept in px so they never round to zero. Tick "Keep 1px values" to leave them unchanged.

Browse all css tools →