Back to Calculators
ToolsCalculatorsPX to REM Converter

PX to REM Converter

Convert layout measurements bidirectionally and map styling classes.

Conversion Panel
Conversion Chart (Base: 16px)
PixelsREMsTailwind Class
4px0.25remw-1
8px0.5remw-2
12px0.75remw-3
16px1remw-4
20px1.25remw-5
24px1.5remw-6
28px1.75remw-7
32px2remw-8
40px2.5remw-10
48px3remw-12
56px3.5remw-14
64px4remw-16
80px5remw-20
96px6remw-24
128px8remw-32

Why Convert PX to REM?

Pixel (PX) is an absolute sizing unit, meaning it represents a fixed physical dot on a screen. REM (Root EM) is a relative sizing unit whose value is calculated relative to the HTML document's root font-size. By default, most modern web browsers define the base font-size as 16px.

Converting pixel dimensions to REM units is an industry-standard best practice for building accessible, responsive web designs. If a user increases their browser's default font size (e.g. for accessibility or visual impairment), REM-based typography, margins, and padding scale proportionally, preventing content overlaps and broken layouts.

How to Use the PX to REM Converter

  • 1

    Define the Root Base Size

    Set the base font-size (default is 16px). This value represents what 1rem evaluates to in pixels.

  • 2

    Enter Absolute Pixels

    Type in any pixel dimension (e.g., 24px) to instantly see its relative REM equivalent (e.g., 1.5rem).

  • 3

    Convert REMs Back to Pixels

    Type in a REM value to calculate its corresponding pixel size based on the set base value.

  • 4

    Use Tailwind Sizing Mapping

    Reference the interactive conversion chart to quickly copy Tailwind utility class names (like w-4, p-8) into your code.