ForHosting KIT · Images

Check icon alignment to grid

Icon grids make a collection feel deliberate, but small coordinate differences are difficult to catch consistently by eye.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

Runs in your browser. Free, unlimited — your data never leaves this page.

This checker compares the left, top, right, and bottom edges of one icon bounding box with the nearest lines on a regularly spaced grid. Set the grid size and an optional tolerance, then receive an overall alignment verdict plus a clear diagnostic for each edge. It is useful for design-system reviews, asset pipelines, and automated quality checks where the same measurable rule must apply to every icon.

Describe the icon and grid in one coordinate system

Enter the icon's bounding box as four coordinates: left, top, right, and bottom. All four values must use the same unit and origin as the grid. For example, if an SVG view box is measured in user units, provide both the box coordinates and grid size in those user units; if your export workflow measures pixels, use pixels throughout. The grid is anchored at zero, and its lines occur at every integer multiple of the grid size in both positive and negative directions. A grid size of eight therefore creates lines at zero, eight, sixteen, twenty-four, and so on, as well as minus eight and minus sixteen. The checker treats horizontal and vertical coordinates identically because the spacing is square and uniform. It accepts fractional coordinates, which matters when vector transformations or scaling produce subpixel bounds. The right coordinate may equal the left coordinate, and the bottom may equal the top, although ordinary visible icons usually have positive width and height. Reversed bounds are rejected because they do not describe a valid box. Most importantly, the grid size must be positive; zero or a negative value cannot define repeated grid lines and produces an input error instead of a misleading verdict.

Understand tolerance and the per-edge result

Tolerance controls how close an edge must be to a grid line to count as aligned. Its default is zero, which requires exact alignment after stable numeric normalization. A positive tolerance is inclusive: with a tolerance of 0.02, an edge exactly 0.02 units from its nearest line passes. For every edge, the response reports the original coordinate, the nearest grid line, the absolute distance between them, and an aligned boolean. It also provides a top-level aligned value that is true only when all four edges pass, plus a misaligned_edges list that names every failing edge. This combination supports both quick decisions and useful feedback. A continuous-integration job can fail on the overall boolean, while a design tool can show precisely which sides need correction. Decimal calculations are normalized to twelve places so familiar floating-point artifacts do not leak into the output. If an edge lies exactly halfway between two grid lines, either line is equally near; the implementation selects one deterministically, while the distance and alignment verdict are unaffected. Tolerance itself must be zero or positive. Choose it according to your export process rather than using a large value that makes the grid rule meaningless.

Use alignment checks in an icon quality workflow

The most reliable workflow measures bounds after the transformations that will actually ship. An icon may be carefully drawn on-grid in its source document yet become fractional after scaling, stroke expansion, view-box adjustment, or export optimization. Feed those final bounds into the checker and keep the result beside other asset checks such as naming, dimensions, and file-size limits. For a strict pixel-icon set, use a zero tolerance when the export is expected to produce integer grid coordinates. For antialiased vector assets, adopt a small documented tolerance that reflects legitimate rounding in your toolchain. Apply the same grid size and tolerance across a collection so a passing result has a consistent meaning. When a check fails, inspect misaligned_edges first, then use each nearest_grid_line value as the correction target. Remember that this capability evaluates the bounding box only. It does not judge optical balance, stroke placement, internal control points, visual weight, or whether the chosen grid suits the artwork. Those remain design decisions. The checker instead provides a narrow, repeatable geometric assertion that is easy to automate, review, and reproduce without a network call, hidden state, or tool-specific interpretation.

Enforce a design-system grid

Check every submitted icon against the same grid size and tolerance before it enters the shared library.

Catch export drift

Test final SVG or raster bounds after scaling and optimization reveal fractional coordinates introduced by the export pipeline.

Explain failed asset checks

Return the nearest line and distance for each edge so contributors know exactly which bounds require correction.

What does the check cost?

Each API check costs $0.002. The browser version can run locally on this page.

Where is the grid origin?

The grid is anchored at zero. Grid lines occur at every positive and negative integer multiple of the grid size.

Is the tolerance inclusive?

Yes. An edge whose distance equals the tolerance is considered aligned.

Can coordinates and grid sizes be fractional?

Yes. All numeric inputs may be fractional, provided they are finite and use the same coordinate system.

What happens when the grid size is zero or negative?

The request returns an invalid input error because a non-positive spacing cannot define the grid.

Does this inspect an SVG or image file?

No. It checks supplied bounding-box coordinates; extracting bounds from a file belongs in the preceding step of your workflow.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/image/icon-grid-alignment-check

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/image/icon-grid-alignment-check \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"bounding_box":{"left":16.02,"top":7.99,"right":47.98,"bottom":40.01},"grid_size":8}'
{
  "bounding_box": {
    "left": 16.02,
    "top": 7.99,
    "right": 47.98,
    "bottom": 40.01
  },
  "grid_size": 8
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "image.icon_grid_alignment_check",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_mb15
max_megapixels12
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →