ATSvg

Icon alignment and optical weight: why your icons look misaligned

Search intent: Professional practice

Home › SVG guides › Icon alignment and optical weight: why your icons look misaligned

Set a batch of icons all to 24×24 and align them to the frame, and they still look uneven — some too big, some sitting high, some off to the left. Nothing is wrong in the code: the eye judges alignment by visual weight, not by bounding box.

Contents

Geometric equality is not visual equality

Inside the same 24×24 box, a square nearly fills it, a circle leaves space all round, and a triangle is more concentrated still. To make all three look the same size, the circle and triangle need to extend slightly past their geometric bounds (overshoot). Most mature icon libraries build that compensation in, which is exactly why cross-library mixing gives itself away.

Baseline, padding and optical centre

In a button with text, an icon should be centred on the text's x-height, not on the line box's geometric centre; icons next to numerals or capital letters often need a 1px nudge up. In a row of icons, check that the padding all round is consistent — many libraries place the artwork inside a 2px inset on a 24 grid while others bleed to the edge, and mixing them produces a ragged baseline.

A quick test page for verification

Build a single throwaway page: a row of icons at the target size, a row next to real interface text, and the same set on light and dark backgrounds. This catches most alignment problems in under a minute. If a particular icon looks wrong, print the SVG at 400px and overlay a grid — you will usually find the artwork is not centred in its viewBox, rather than a CSS problem.

Fix at the source, not with margins

When one icon sits wrong, the temptation is margin-top: -1px. That patch then breaks at another size. The durable fix is to correct the artwork — re-centre the paths inside the viewBox, or replace the asset. If you cannot edit the asset, wrap it in a fixed-size container and position the inner SVG with a documented offset, so the correction is visible in the code rather than invisible in a pile of margins.

Why pixel-grid alignment alone is not enough

Snapping to whole pixels removes blur, but it does not fix optical weight. Two icons can both sit exactly on the grid and still look unequal because one has more solid area. Treat grid alignment as hygiene and optical alignment as the actual design work — they solve different problems, and skipping the second is why a set of technically-perfect 24px icons can still look sloppy.

FAQ

Why does one icon look larger than the others in the same set?Different shapes fill their bounding boxes differently. A square occupies more of the box than a circle or triangle, so the latter two need overshoot to look equal.
Is optical alignment really necessary for a small product?It matters more, not less: with fewer icons on screen, each one is scrutinised more. A single misaligned icon in a small set is more noticeable than in a large grid.

← All SVG guides · Licence and usage FAQ →

Related assets · 12 assets

Keep reading

All guides