Make equal gaps in Illustrator

Space objects of different widths evenly, using either a fixed span or a specified gap.

Asset preparation3 min read

Four objects can have evenly spaced centers and still have visibly uneven gaps. When their widths differ, use Distribute Spacing to control the space between their edges. Use Distribute Objects when the positions of their centers or corresponding edges are what should repeat.

Calculate the gap in a fixed span

Suppose four rectangles, left to right, are 80, 160, 100 and 120 px wide. The left edge of the first is at x = 0 and the right edge of the last is at x = 700. Their combined width is 460 px, leaving 240 px for three gaps. Divide 240 by 3: each gap should be 80 px.

With equal gaps, the rectangles occupy x = 0–80, 160–320, 400–500 and 580–700. By comparison, placing their centers at x = 40, 240, 440 and 640 gives gaps of 80, 70 and 90 px. Only the third rectangle moves. Its left edge shifts 10 px to the right, from 390 to 400.

Four rectangles of unequal widths in two rows. With evenly spaced centers, their gaps are 80, 70 and 90 px; with evenly spaced edges, each gap is 80 px. The outside edges stay fixed.

Equal center intervals above; equal edge gaps below.

Download the two-page vector exercise (PDF). Page 1 is the starting row. Page 2 is the answer. In Illustrator, open page 1 with File > Open and leave Import PDF pages as links unchecked so you can select the four rectangles. Use the steps below, then compare the purple rectangle with page 2.

Set the gap in the Align panel

  1. Select the objects with the Selection tool and open Window > Align. In the panel menu choose Show Options if Distribute Spacing is hidden.
  2. Click the first object again without Shift to make it the key object. Illustrator marks it with an outline; the other objects will distribute relative to it.
  3. Enter 80 px in Distribute Spacing, then click Horizontal Distribute Space. For a column, use Vertical Distribute Space instead. Adobe documents the exact-spacing controls and key-object selection.
  4. Check both end positions and the resulting gaps. In this example, the calculated value preserves the 700 px span. A different specified gap changes the span: a key object fixes one reference, not both ends independently. Undo and recalculate if the far end moves outside its boundary.

For another fixed span, subtract the total object widths from the distance between the outer edges, then divide by one fewer than the number of objects. If the result is negative, the objects cannot fit without overlap at their current widths. Resize the objects or enlarge the span first.

Check what the bounds contain

The distance Illustrator distributes follows the selected objects' bounds. A group, clipping mask, stroke, effect or invisible element can make those bounds differ from the visible artwork. Inspect each selection before treating the calculated gap as visible whitespace; check the application's Use Preview Bounds setting when strokes or effects affect the result. For padded logo files, compare the visible logo bounds before judging the visible spacing. Brand clear space and optical balance may still call for a deliberate adjustment after the geometric pass.

Image tools
All guides
Make equal gaps in Illustrator | Formatry Media — Formatry