Spacing and typography scale

The secret to making a website look organized, not random

AI-built websites often look almost right but not quite, because their spacing is random, like 13 pixels in one section and 27 in another. A uniform scale locks down the options, ensuring every margin and text size comes from the same system. You choose a base unit of 4 or 8 pixels, a base text size between 16 and 18, and a growth ratio of 1.2, 1.25, or 1.333. The tool generates ten spacing steps and eight text sizes, from footnotes to main headings, displaying each step visually. The copyable code is a :root block with CSS variables in rem units. Everything is calculated in your browser.

Frequently asked questions

Why exactly 4 pixels?

This is the standard unit in modern design systems. All spaces are multiples of it, which creates that organized feeling.

What is a growth ratio?

It is the ratio between one text size and the next. A higher ratio creates a more dramatic difference between headings and body text.

Why are the values in rem instead of pixels?

The rem unit is based on the font size the user set in their browser. Someone who enlarged text for accessibility reasons will get the whole site scaled up by the same ratio, which does not happen with pixels. The calculation is 16 pixels to one rem.

How do I get an AI website builder to use the scale?

Paste the variables block and explicitly tell it that every space and text size must only use these variables. Without this instruction, it will keep inventing values.

Which growth ratio should I choose?

A ratio of 1.25 fits most websites. Use 1.2 when there is a lot of continuous text, and 1.333 for a landing page with large headings. With a base of 16, the main heading comes out to 49 pixels at a 1.25 ratio and 67 at a 1.333 ratio.

More tools you might need

All tools in AI Website Builders