KickSolve • Free • Private

PX to REM Converter

Convert pixels to rem and em in real time, with your own base font size. Use the quick reference table, or paste a block of CSS and convert every px value at once.

px, rem and emCustom base font sizeConvert whole CSS blocks

Quick reference

pxremem
Click a row to copy its rem value.

Convert a block of CSS

How to use PX to REM Converter on KickSolve

Three quick steps, no account needed.

Enter a valueType pixels, rem or em in any box and the other two update instantly.
Set your base sizeChange the base and parent font size if your site does not use 16px.
Copy the resultCopy a single value, or paste CSS and convert every px value at once.

Why choose KickSolve

Built for speed, privacy and clean results.

Private by designEverything runs in your browser and nothing is uploaded.
Three units at onceSee px, rem and em together as you type.
Built for real projectsCustom base size, decimals and a bulk CSS converter.
Fast and freeNo sign up and no limits.

What you can do with PX to REM Converter

Everything this tool offers.

Two-way conversionType in px, rem or em and get the others.
Custom base sizeMatch your html font size, such as 10px or 18px.
Parent size for emCalculate em relative to any parent font size.
Quick reference tableCommon sizes from 8px to 96px, click to copy.
CSS block converterConvert every px value in pasted CSS to rem.
rem to px modeConvert rem values in CSS back to pixels.
Keep 1px optionLeave hairline borders untouched.
Decimal controlChoose 2 to 5 decimal places.

About PX to REM Converter on KickSolve

What it does and how to get the best results.

How the px to rem converter works

Rem stands for root em, a unit relative to the font size of the html element. The converter divides the pixel value by your base font size to get rem, and multiplies the rem value by the base to get pixels. Em values use the parent font size you set. Everything runs in your browser.

The px to rem formula

  • rem = px / base font size
  • px = rem x base font size
  • em = px / parent font size

Why use rem units

Rem units respect the font size a user chooses in their browser, so layouts that use rem scale for people who need larger text. They also make it easy to scale a whole design by changing one value on the html element.

Rem vs em vs px

Pixels are fixed and ignore user preferences. Rem is relative to the root, so it is consistent across the page. Em is relative to the parent, which is useful for components that should scale with their own text size but can compound in nested elements.

The 62.5% trick and other bases

Some teams set the html font size to 62.5%, which makes 1rem equal 10px and simplifies the math. It works, but it requires resetting the body font size back to 1.6rem. If you use a custom base, enter it in the settings so every conversion matches your project.

Good to know

  • Media queries often work better in em or rem so they respond to the user's font size, but they are not always safe to convert in bulk.
  • Unitless line-height is usually better than a converted value.
  • Check the converted CSS before shipping it.

Common px to rem values

At the default 16px base font size.

PixelsREMEM
8px0.5rem0.5em
12px0.75rem0.75em
14px0.875rem0.875em
16px1rem1em
18px1.125rem1.125em
20px1.25rem1.25em
24px1.5rem1.5em
32px2rem2em
40px2.5rem2.5em
48px3rem3em
64px4rem4em

Frequently asked questions

Quick answers.

How do I convert px to rem?

Divide the pixel value by the root font size. With the default 16px base, 24px divided by 16 equals 1.5rem. This converter does it instantly in both directions.

What is the formula for rem to px?

Multiply the rem value by the root font size. At a 16px base, 1.5rem times 16 equals 24px.

What is the default base font size?

Browsers use 16px as the default root font size. If your site sets a different font size on the html element, enter that value as the base font size in the settings.

Why use rem instead of px?

Rem units scale with the user's browser font size setting, so text and spacing grow for people who increase their default size. Pixels stay fixed, which can hurt accessibility.

What is the difference between rem and em?

Rem is relative to the root element's font size, so it is predictable everywhere. Em is relative to the font size of the parent element, so nested elements can compound.

What is the 62.5% trick?

Setting html font-size to 62.5% makes 1rem equal 10px, which makes mental math easier. Change the base font size here to 10 if you use it.

Should I convert 1px borders to rem?

Usually not. A 1px border is meant to be a hairline, and 0.0625rem can render inconsistently. The CSS converter keeps 1px values unchanged by default.

Can I convert a whole stylesheet?

Yes. Paste CSS into the converter box and every px value is converted to rem, or switch the direction to convert rem back to px. Review the result before using it, because media queries and some properties may be better left in px.

How many decimals does the converter use?

Up to four by default, with trailing zeros removed. You can choose 2 to 5 decimal places in the settings.

Is anything uploaded or stored?

No. The conversion runs in your browser and nothing is sent to a server.

More free tools from KickSolve

Related everyday tools.