PX to REM Converter
Runs locallyConvert 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
- Step 1
Enter any value and unit (or a batch list of px values) and set your root font size (default 16px).
- Step 2
Inspect exact conversions to rem, em, pt, vw, vh, and % plus nearest Tailwind spacing token.
- Step 3
Switch to the Fluid clamp() tab to calculate viewport-interpolated typography or spacing.
- 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.
Related tools
CSS Formatter & Minifier
Format or minify CSS/SCSS, sort properties, compute specificity and convert to JS or Tailwind.
CSS Gradient Generator
Design linear, radial, conic and OKLCH gradients with export to CSS, Tailwind, SwiftUI and Compose.
Flexbox Playground & Generator
Interactive CSS Flexbox builder with container/item controls and Tailwind export.
CSS Grid Generator
Visual CSS Grid builder with columns, rows, gap, item spans and Tailwind output.