PX to REM & clamp()
Convert px and rem; generate fluid clamp() CSS.
px ⇄ rem
Browser default is 16px
Conversion table at 16px
Fluid size with clamp()
font-size: clamp(1.125rem, 0.7624rem + 1.547vw, 2rem);The quick brown fox
How to use
- 1Set the root font size (16px by default).
- 2Type pixels or rem; the other updates instantly.
- 3For fluid sizes, enter mobile and desktop sizes and screen widths.
- 4Copy the clamp() CSS and test it with the preview slider.
Frequently asked questions
How do I convert px to rem?
Divide pixels by the root font size. With the default 16px, 24px = 1.5rem.
Why use rem instead of px?
rem scales with the user's browser font setting, which improves accessibility.
What does clamp() do?
clamp(min, preferred, max) lets a size grow with the screen width but never go below the minimum or above the maximum.
Is the clamp formula accurate?
Yes. It uses a linear interpolation between your two screen widths, expressed in rem plus vw.
Is my data uploaded?
No. Everything runs in your browser; nothing you paste is sent to a server.
You may also need
Flexbox & Grid Generator
Build flex and grid layouts visually; copy CSS.
Fake Data Generator
Indian test data as JSON, CSV, Excel or SQL.
JWT Generator
Sign JWTs with HS256/384/512 or verify a signature.
Bcrypt Generator
Hash passwords with bcrypt or check a hash.
AES Encryption
Encrypt and decrypt text with a password (AES-256).
TOTP Generator
2FA codes and authenticator QR for testing.