In short: The secret to an orderly look is choosing the values for white space in web design from a scale, not at random. The most common method is the 8pt grid: you choose all spacing and sizes from multiples of 8 (or 4 for small adjustments). You handle grouping with the Gestalt principles: the eye sees elements that are close to each other and similar to each other as a group. When you use these two tools together, the page looks orderly without adding a single line.
White space in web design: In short…
White space in web design is not “leftover space”; it is a language that describes the relationships between elements. A heading, for example, sits close to its own paragraph and far from the previous section. That distance tells the reader what the heading belongs to. In this post I explain how to tie your spacing to a system (the 8pt grid) and how to make the eye read groups (the Gestalt principles).
Why does white space matter so much in web design?
The problem I see most often in beginners’ designs is not colour or font but inconsistent spacing. Say the padding of one card is 15 pixels, the one next to it 18, and the gap between heading and text 11. Even if the eye does not notice each difference, the page looks “messy”. So the fix for white space in web design is to choose from a limited list of values instead of picking a new number every time.
What is the 8pt grid?
The 8pt grid is a system that uses multiples of 8 for spacing, element heights and widths in web design: 8, 16, 24, 32, 48, 64… For very small gaps, such as between an icon and text, you use 4 pixels as a half step. Google’s Material Design system, for example, also aligns interface elements to an 8dp grid, and icons and small elements to 4dp (Material Design).

Why 8?
- It divides easily: 8 divides evenly by 2 and 4, so half and quarter steps stay whole numbers.
- It stays crisp at different screen densities: On 1.5x, 2x and 3x screens, multiples of 8 land on whole pixels, so edges do not blur.
- It reduces decision fatigue: The question “15 or 17?” disappears, because the options are 16 and 24.
- It creates a shared language within the team: Designers and developers use the same values. Defining these values as variables in CSS also keeps the code consistent.
How do you apply the 8pt grid?
- Define a spacing scale: for example 4, 8, 12, 16, 24, 32, 48, 64, 96.
- Choose a value for each type of spacing: icon to text 8, between paragraphs 16, inside cards 24, between cards 32, between sections 64, and so on.
- Tie element heights to the scale as well: 40 or 48 pixel buttons, 48 pixel form fields.
- Do not forget line height: giving 16 pixel text a 24 pixel line height puts the text on the grid too.
- Set the “nudge” value to 8 in Figma, so Shift plus the arrow keys moves elements 8 pixels at a time.
See the scale as a starting point, not a strict rule. Sometimes 20 pixels will look more right to you. What matters is that such exceptions are deliberate and few.
A rule for white space in web design: inner spacing should be smaller than outer spacing
The simplest rule of grouping is this: the spacing inside a group should be smaller than the spacing between groups. If a card’s padding is 24 pixels, for example, the gap between cards should be at least 32 pixels. In the same way, the space below a heading should be smaller than the space above it. When you break this rule, the reader cannot work out which element belongs to which. The Gestalt principles explain why.
What are the Gestalt principles in web design?
Gestalt is a theory of perception developed by German psychologists in the early 20th century. Its core idea is that people perceive parts not one by one but as wholes. Nielsen Norman Group examines how these principles apply to interface design in detail (NN/g). These are the four principles that will help you most with white space and grouping in web design:

Proximity
The eye sees elements that sit close together as a group. In the first frame of the image the dots are identical, but the difference in spacing between them splits them into three groups. In forms, for example, a label sitting closer to its own field than to the next field relies on this principle. Most of the time you can group with spacing alone, without adding a frame or a line.
Similarity
The eye assumes that elements similar in colour, shape or size belong together. That is why all links on a site should share the same colour, and all primary buttons the same style. The reverse also holds: if you set non-clickable text in the link colour, the reader will think it is a link.
Closure
The eye completes incomplete shapes. We still see a broken circle as a circle, for example. Designers often use this principle in logo design. In interfaces, it lets us see a borderless card as a single area thanks to its background colour.
Continuity
The eye keeps following a line or a flow. Aligned elements, horizontally scrolling product lists and step indicators all make use of this principle. A card cut off at the edge of the screen, for example, uses continuity to say “there is more if you scroll right”.
White space and Gestalt in web design: a practical checklist
- Do all your spacing values come from a single scale?
- Is the inner spacing of each group smaller than the spacing between groups?
- Are headings closer to their own content than to the previous section?
- Do elements with the same function (links, buttons) look the same?
- Before adding a frame, can you achieve the same grouping with spacing?
These rules are the foundation of composition and hierarchy. I covered placement in the post on composition in graphic design, and order of importance in the post on visual hierarchy. You can read about choosing font sizes from a scale, just like spacing values, in the post on type scales and colour palettes. I explained setting spacing with auto layout in Figma in the Figma guide.
Frequently asked questions
Is the 8pt grid mandatory?
No. Some teams prefer other systems, such as 4pt or multiples of 5. What matters is choosing a system and sticking to it. The 8pt grid is a good default because it is widely used and works well with screen densities.
Are the 8pt grid and the 12-column grid the same thing?
No. The 12-column grid sets the page’s horizontal layout (the columns), while the 8pt grid sets spacing and sizes. You use them together: you can also choose column and gutter widths in multiples of 8. I explained the column grid in the post on composition.
What happens if there is too much white space in web design?
Groups drift apart and the page looks empty and disconnected. White space describes relationships. Giving everything the same generous spacing erases those relationships, just as giving everything the same tight spacing does.
This post is based on information valid as of November 2026.


