About this tool
Paste a list of sizes to snap each one down, up or to the nearest multiple of your grid unit. Below that, enter a container width, number of columns, gutter and margins to get the exact column width and a CSS grid you can copy. It flags whether the columns land on your grid.
How to use 8px Grid Calculator
- Set the grid unit (8px by default).
- Paste the values to snap.
- Enter container width, columns, gutter and margin.
- Copy the snapped values or the CSS grid.
Frequently asked questions
Why design on an 8-point grid?
Most screen sizes divide evenly by 8, so elements scale cleanly across densities, and a limited set of values speeds up decisions.
My column width is not a whole number. Is that a problem?
Not in CSS, where fractional pixels are fine. If you need whole pixels, adjust the gutter or container width until the columns divide evenly.