Choosing icon size: the trade-offs at 16 / 20 / 24 / 32
Search intent: Specification decision
Icon size is not a matter of “looks about right”. A 1.5px stroke occupies nearly 10% of a 16px grid and only 5% of a 32px grid. Change the size and the stroke width, cap rounding and detail density all have to change with it, or the set ends up with some icons looking heavy and others light.
Contents
- Choosing among the four common sizes
- Separate viewBox from displayed size
- Hit area is not the same thing as icon size
- Mixing sizes on one page
- Icon size on responsive layouts
Choosing among the four common sizes
16px suits table rows, tags and dense admin screens — detail has to be minimal, and filled versions usually work better. 20px suits buttons and form prefixes. 24px is the general-purpose baseline for product interfaces, and most open-source icon libraries use 24 as their canvas. Only above 32px do duotone, gradients or decorative detail make sense.
- 16px: prefer filled; avoid complex shapes with inner strokes
- 20px: line style, stroke-width around 1.5, rounded caps
- 24px: the general baseline — normalise a whole set to this viewBox
- 32px+: duotone or illustration becomes viable, but do not fill a screen with them
Separate viewBox from displayed size
The viewBox is the internal coordinate grid (0 0 24 24); width / height or CSS decide the rendered size. Displaying a 24-grid icon at 16px works, but the stroke gets thinner. The correct approach is to use a library's native 16-grid version, or normalise stroke-width first and then scale the whole set.
<!-- 内部 24 网格,显示 24px -->
<svg viewBox="0 0 24 24" width="24" height="24" ...>
<!-- 同一文件显示 16px:线条视觉上会变细 -->
<svg viewBox="0 0 24 24" width="16" height="16" ...>Hit area is not the same thing as icon size
A 16px icon does not mean a 16px button. Interactive targets should be at least 32–44px, achieved with padding while the SVG stays centred. This matters most on mobile: “hard to tap” is nearly always a target that is too small, not an icon that is drawn too small.
- Icon size: the visual size
- Button size: the tappable area
- Decouple the two with padding; never scale the icon up to fill the target
Mixing sizes on one page
Use one size per level of hierarchy. Navigation, list rows and buttons can each differ, but icons on the same row must match. If one item truly needs emphasis, use colour or a background — do not nudge it 2px larger, because that tiny difference reads as a misalignment rather than emphasis.
Icon size on responsive layouts
Responsive does not mean scaling icons by container percentage. Once a stroke lands on a fractional pixel the edge goes soft, and different stretch ratios make icons in one row look different weights. Instead, define a few breakpoints and switch to discrete size steps (20px on narrow screens, 24px on wide) while keeping the viewBox and stroke-width pairing intact. Dense table areas can drop one step, but never allow two sizes within one level.
- Switch between discrete steps, not percentage scaling
- Adjust icon-to-text spacing at the same breakpoint
- Avoid fractional pixels, which soften edges
- One size per hierarchy level
FAQ
Related assets · 12 assets