Skip to main content

PX to REM Converter

Runs locally

Convert px, rem, em, pt, vw, vh and % with Tailwind scale, fluid clamp() and type scales.

What is PX to REM & Fluid Clamp Calculator?

Convert CSS units across px, rem, em, pt, vw, vh, and % with custom root font sizes and parent context sizes. Generate fluid CSS clamp() formulas from min/max viewport widths, inspect Tailwind spacing matches, and export CSS custom properties.

How to use PX to REM & Fluid Clamp Calculator

  1. Step 1

    Enter any value and unit (or a batch list of px values) and set your root font size (default 16px).

  2. Step 2

    Inspect exact conversions to rem, em, pt, vw, vh, and % plus nearest Tailwind spacing token.

  3. Step 3

    Switch to the Fluid clamp() tab to calculate viewport-interpolated typography or spacing.

  4. Step 4

    Copy the generated CSS variable scale or clamp() declaration.

Features

  • Bidirectional px, rem, em, pt, vw, vh, and % converter with custom root & context sizes
  • Batch conversion table and nearest Tailwind CSS spacing utility lookup
  • Fluid clamp(min, preferred, max) calculator with viewport width slope math and live preview
  • Modular type scale generator (Minor Third, Major Third, Perfect Fourth, Golden Ratio)
  • One-click copy as CSS variables (:root) or Tailwind config
  • Runs locally in your browser

Example

Input

min: 18px @ 375px, max: 36px @ 1280px (root 16px)

Output

clamp(1.125rem, 0.658rem + 1.989vw, 2.25rem)

Smoothly scales font-size from 18px on mobile to 36px on desktop without media queries.

Frequently asked questions

Why prefer rem over px for font sizes?

rem respects the user’s browser root font-size preference, improving accessibility for low-vision users.

How does the fluid clamp() calculator work?

It solves the linear equation between your min and max viewport widths so the value scales linearly in vw + rem.

Can I change the base font size from 16px?

Yes. Set any root size (e.g. 10px, 14px, 16px, 18px) and optional parent em context.

Does it work offline?

Yes, all calculations run locally in your browser.