A spacing scale is the short list of sizes your margins, paddings and gaps are allowed to use. Pick a base unit (4 px for fine control, 8 px for roomier layouts) and get the full scale, named the way Tailwind names its steps, as CSS variables in rem or px, the single Tailwind v4 setting that drives it, or JSON tokens for a design system. Already have your own sizes? Paste them and get rem variables for those too.
4px is the usual grid (Tailwind, Material); 8px for roomier layouts
16px unless your site changes it
:root {
--space-0: 0;
--space-0_5: 0.125rem;
--space-1: 0.25rem;
--space-1_5: 0.375rem;
--space-2: 0.5rem;
--space-2_5: 0.625rem;
--space-3: 0.75rem;
--space-4: 1rem;
--space-5: 1.25rem;
--space-6: 1.5rem;
--space-8: 2rem;
--space-10: 2.5rem;
--space-12: 3rem;
--space-16: 4rem;
--space-20: 5rem;
--space-24: 6rem;
--space-32: 8rem;
}Separate with commas or spaces
4px = 0.25rem 8px = 0.5rem 12px = 0.75rem 16px = 1rem 20px = 1.25rem 24px = 1.5rem 32px = 2rem 48px = 3rem 64px = 4rem
Calculating runs in your browser. What you type never leaves this device.
Scale from any base unit, with Tailwind-style step names (0.5, 1, 1.5, 2 ... 32)
Visual bars so you can see the jumps between steps
Export as CSS variables (rem or px), Tailwind v4 --spacing or JSON design tokens
Any root font size for the rem values
Paste your own list of px values and get rem values and CSS variables
One agreed set of spacing tokens shared by designers in Figma and developers in code.
Paste the margins and paddings your CSS already uses and turn them into a short list of named variables.
Change the base unit of every p-*, m-* and gap-* class in Tailwind v4 with one line.
rem tokens grow when a reader raises the browser font size, which keeps spacing in proportion with bigger text. px tokens stay fixed. rem is the common choice for websites; the rem values here are the px values divided by the root font size.
PX to REM Converter
Pixels to rem and em, and back, for any root font size
8px Grid Calculator
Snap sizes to an 8-point (or any) grid, with a spacing scale
Type Scale Generator
Modular or fluid type scales as CSS variables or Tailwind
CSS clamp() Generator
Fluid font sizes, padding and gaps between two screen widths
JSON Formatter
Format and validate JSON
JSON Sort Keys
Alphabetize JSON keys at every level
JSON Flatten
Nested JSON to dot-path keys
JSON Unflatten
Dot-path keys back to nested JSON
Built by Edesy
Edesy builds AI products for Indian businesses. Start self-serve, no demo call needed.
AI agents that answer and make phone calls 24/7. Handle appointments, inquiries and support in Indian and global languages.
₹50 free credit. No demo call needed.