How to use the Spacing & Scale Calculator
- Enter your details in the fields above.
- See your results instantly - free, no signup.
- Copy, share or bookmark the result.
What Is the Spacing & Scale Calculator?
The Spacing & Scale Calculator turns a base size and a multiplication ratio into a consistent spacing scale. Instead of choosing unrelated margins and padding values, you get a sequence of sizes that share the same mathematical relationship. It is useful when planning spacing tokens for a website, interface, or small design system.
The tool displays ten steps, numbered -3 through 6, with step 0 representing the base. Each result includes a rounded pixel value, a rem equivalent, and a horizontal visual indicator. This is a spacing scale calculator rather than a layout inspector: it does not measure an existing page or decide which spacing belongs on each component.
How to Use the Spacing & Scale Calculator?
Start with Base size (px), which defaults to 16. Open Ratio and choose one of eight options: Minor Second 1.067, Major Second 1.125, Minor Third 1.200, Major Third 1.250, Perfect Fourth 1.333, Aug Fourth 1.414, Perfect Fifth 1.500, or Golden Ratio 1.618. The initial selection is Major Third.
The Scale panel updates as you change either input. Read the step labels alongside the px and rem values, then use the copy control to copy the complete list. There is no separate Generate button. The copied output is a text list of steps, not CSS custom property declarations, so assign your own token names when moving it into a stylesheet.
Practical Examples and Use Cases
- For a card layout, compare the smaller steps for internal gaps and the larger steps for padding or separation between groups. A common scale gives you a shortlist without requiring every gap to be identical.
- For a compact settings screen, try a smaller ratio to keep neighboring values closer together. For a spacious landing page, compare a larger ratio before committing to it.
- For a handoff document, copy the scale and explain which steps correspond to component padding, section spacing, and smaller inline gaps.
With the default 16px base and 1.25 ratio, step -1 rounds to 13px, step 0 is 16px, and step 1 is 20px. These examples show why the results are not a fixed 4px grid: the progression multiplies rather than adds.
Best Practices and Tips
- Choose a positive base that matches a meaningful size in your interface. Empty or unsuitable numeric input does not provide a useful design scale, and the field does not impose a positive minimum.
- Check the numbers rather than judging only the bars. The visual bar width is capped, so very large results can look equally wide even when their values differ.
- Remember that rem values use a fixed 16px divisor. If your site changes the root font size, the copied rem values will display differently from the listed pixel sizes.
- Keep the useful steps and name them clearly. You do not have to use every generated value, and small ratios can produce repeated pixel values after rounding.
- Test spacing with real content at narrow and wide viewport widths. Mathematical consistency is a starting point, not a guarantee of comfortable layouts.
Useful for
- Planning spacing tokens
- Comparing modular spacing ratios
- Documenting component padding
- Choosing related layout gaps
Who should use it
- UI designers
- Frontend developers
- Design system maintainers
- Freelancers building websites
Common mistakes to avoid
- Treating the scale as fixed pixel increments
- Ignoring rounding between nearby steps
- Assuming rem conversion uses your site settings
- Judging large values only by bar width
When not to use it
- When you need to measure spacing on an existing page
- When you need ready-made CSS variable declarations
Frequently asked questions
Does this create a fixed 8px spacing grid?
No. It multiplies the base by the selected ratio for each step, then rounds to whole pixels. It does not generate fixed increments.
How many spacing values are generated?
Ten values are shown, from step -3 to step 6. Step 0 is the rounded base size.
Why might the rem values differ on my website?
The calculator divides pixel values by 16. A different root font size changes how those rem values display.
Can I copy CSS spacing variables?
The copy control copies a plain text list with step labels, pixels, and rem values. Create your own CSS variable declarations from that list.
Related Design Tools
- Border Radius Previewer - Preview and generate CSS border-radius values visually
- Color Palette Generator - Generate harmonious color palettes for your next project
- Contrast Checker - Make sure your text is readable against its background (WCAG)
- Font Pairing Helper - Discover font combos that look great together
- Gradient Generator - Build beautiful CSS gradients and grab the code instantly
- Image Size Cheat Sheet - Quick-reference guide for social media and web image dimensions
- Lorem Ipsum Generator - Generate placeholder text for your designs and layouts
- Box Shadow Generator - Create custom CSS box shadows with a live preview