InputTestHub

Spacing Scale Generator

Generates a consistent spacing scale from a base unit, output as CSS variables, SCSS or Tailwind config.

Colour & Design Nothing uploaded No sign-up Free, unlimited
Colour & Design tool
Fill in the fields and press Generate.
In short A spacing scale is a fixed set of allowed gaps — typically built from a 4px or 8px base — and its value is not that the numbers are correct but that there are only eight of them. Most inconsistent-looking interfaces are inconsistent in their spacing rather than their colour or type: a 12px gap here, 14px there and 15px somewhere else, none of them wrong and none of them the same. Restricting yourself to a scale makes that impossible by construction. Four is the usual base because it divides cleanly into the 8px rhythm most design systems use while still allowing a genuinely tight 4px gap for things like the space between an icon and its label. A doubling scale — 4, 8, 16, 32, 64 — gives large obvious jumps and few options, which is easy to apply and sometimes too coarse in the middle. A linear one gives finer control and more decisions. The output belongs in CSS custom properties or a Tailwind config rather than typed into rules, because the whole benefit disappears the moment someone writes `margin: 13px`. Consistency here beats correctness: a scale everyone actually uses is worth more than a better scale nobody follows.

How to use the Spacing Scale Generator

  1. Fill in the fields with your own details.
  2. The generated code updates live in the output panel.
  3. Copy the code and paste it into your page, file or CMS.

About the Spacing Scale Generator

The Spacing Scale Generator generates a consistent spacing scale from a base unit, output as CSS variables, SCSS or Tailwind config. It runs as plain JavaScript inside the page, which means there is no upload step, no queue and no size limit imposed by a server — the only limit is your own device.

What people use it for

  • Setting up spacing tokens for a design system.
  • Enforcing an 8-point grid.
  • Making padding and margin decisions systematic.

Frequently asked questions

Does the Spacing Scale Generator cost anything?
No charge and no sign-up. There is no free tier to run out of because there is no paid tier — inputtesthub.com is funded by advertising rather than by metering the tool.
Can you see what I put into this tool?
No. The Spacing Scale Generator runs entirely in your browser using JavaScript. Because the work happens locally, the tool also keeps working if your connection drops, and closing the tab is all it takes to discard everything.
What is the Spacing Scale Generator used for?
In practice it gets used for three things: setting up spacing tokens for a design system. Enforcing an 8-point grid. Making padding and margin decisions systematic. It is built for exactly those cases rather than being a general-purpose tool with this bolted on.
Will this work on a tablet?
Yes. The page is responsive and the tool works in Chrome, Safari, Firefox, Edge and Samsung Internet on both Android and iOS. There is no app to install and nothing to sign into.

Related colour & design tools

All 33
01

CSS Gradient Generator

Builds linear, radial and conic CSS gradients with multiple stops, live preview and copyable…

02

Box Shadow Generator

Builds CSS box shadows with multiple layers, live preview and copyable output including inset…

03

Text Shadow Generator

Creates CSS text shadows including outline, emboss, neon and long-shadow effects.

04

Border Radius Generator

Builds CSS border-radius including per-corner and elliptical values, with a live preview.

06

Neumorphism CSS Generator

Generates soft-UI shadows where an element appears extruded from or pressed into the background.

07

Cubic Bezier Generator

Builds CSS easing curves with a draggable preview and a library of standard easings.

08

CSS Filter Generator

Builds CSS filter chains — blur, brightness, contrast, grayscale, hue-rotate, invert…

09

CSS Transform Generator

Builds CSS transforms — translate, rotate, scale, skew and 3D perspective — with a live preview.

10

Flexbox Generator

Builds flexbox layouts visually and outputs the CSS, with every alignment and wrapping option…