New

Optical Alignment

Placing shapes, letters and text where they look aligned to the eye, even when measurement says they are off.

11 min read

Reviewed by Ravi SuranaUpdated

Quick answer

~20 sec

Optical alignment is placing shapes, letters and text where they look aligned to the eye, even when they are not aligned by measurement. Design software centers a shape using the smallest rectangle that fits around it. People judge position by how heavy a shape looks, so a designer moves the shape slightly until it appears centered.

012 min

The problem optical alignment solves

Say a designer is drawing a play button for a video app. It is a triangle that points right, inside a circle. They select both shapes and use the center command. The software puts the triangle exactly in the middle, yet the triangle looks as if it sits too far to the left.

The software did what it was asked. It centers a shape by its bounding box, which is the smallest rectangle that fits around the shape. For a square or a circle, the middle of that rectangle is also where the eye expects the middle to be. A triangle is different. Its left side is a tall flat edge and its right side narrows to a point, so most of the shape sits on the left. The middle of the rectangle is not the middle of the shape.

People do not read a shape as a set of coordinates. They read how much of it is there and where it sits. That is why a position can be correct by measurement and still look wrong. To fix it, the designer stops trusting the numbers for a moment and moves the shape until it looks right. In the play button, that means shifting the triangle to the right, away from its heavy side.

The alternative has a name too. Mathematical alignment places things by measured coordinates, and it is enough in most layouts. Optical alignment matters for the shapes where the numbers and the eye disagree.

bounding boxshifted right
Compare the two windows. After the move, the triangle has the same distance between each of its three corners and the edge of the circle.

022 min

How optical alignment works

The play button is one case of a general rule. The eye judges a shape by its visual weight, which is how much mass the shape seems to have and where that mass sits. To find where a shape looks centered, a designer asks where its weight is, not where its outline ends.

A square and a circle show the rule in its simplest form. Draw both 24 pixels wide and 24 pixels tall, and the circle looks smaller. The corners are the reason. A square fills its whole box, and a circle fills about 79% of it. Designers make up the difference by drawing the round shape a little larger.

Matching a circle to a square by area

Marc Edwards, the founder of the design studio Bjango, published a calculation for this in February 2023. He gives the circle the same area as the square. That means scaling the circle to 112.84% of the square's width. A 24 pixel square then pairs with a circle about 27.1 pixels wide.

Shapes with holes and dents

The area method works for solid shapes. A ring or a star has empty parts that lower its area without making it look smaller. Edwards's answer is to ignore the holes and dents and measure the area inside the outline drawn tight around the whole shape. The name for that outline is the convex hull.

Where the center of a triangle is

Back to the play button. A triangle has several kinds of center, and the center of its bounding box is not the one that looks right. The one that works is the centroid, the average position of all the points in the shape.

In an equilateral triangle, which has three equal sides, the centroid is one third of the way along from the flat side. The bounding box center is halfway. So the triangle has to move toward its point by one sixth of its width. For a triangle with a 24 pixel flat side, the width is about 20.8 pixels and the move is about 3.5 pixels. Edwards reports that when the centroid sits on the circle's center, the triangle looks centered, and its three corners are the same distance from the edge of the circle.

032 min

Optical alignment in letters: overshoot

Type designers met this problem long before interface designers did. Take a capital O and a capital H. If the O were drawn exactly as tall as the H, it would look shorter, for the same reason a circle looks smaller than a square. So type designers draw the O slightly taller, and its top and bottom go a little past the lines where flat letters stop. That extra height is called overshoot. Its purpose is that letters of different shapes look the same size even though they are not.

How much letters overshoot

The amount depends on the typeface. About 1% to 3% of the height of a capital letter is typical for the O. Peter Karow, in his book Digital Formats for Typefaces, recommends 3% for an O and 5% for an A. Pointed letters need more because the tip of the A touches the line at a single spot and holds almost no weight there.

Take a typeface whose capitals are 700 units tall; the size is made up for this example. An O with 3% overshoot goes 21 units past the line at the top and again at the bottom.

The same fix in the game of go

Go is played with black and white stones. The stones are made in slightly different sizes, with the black ones a little larger, so that side by side the two colors appear to be the same size.

042 min

Optical margins and hung punctuation

The same problem appears at the edge of a column of text. Picture a block quote in a book. Its first line begins with an opening quotation mark, so the first word of that line starts a little to the right of the first word on every other line. The fix is to hang the mark: place it in the margin, outside the text edge, so the words of all lines start on one straight line.

Page layout programs do this with a setting called optical margin alignment. It moves letters such as A, V, W and Y, and punctuation, a little way into the margin so the edge of the text looks even. These characters leave empty space at the line edge, so a line that starts or ends with them looks shorter than it is. The idea reaches past punctuation. In a list on a screen, a bullet or an icon can hang to the left of the text edge, so that the words line up with the heading above them.

Where the practice began

The Gutenberg Bible, held in the British Library, shows punctuation and large first letters set slightly into the margin. Printers set text this way long before layout software could do it for them.

Where optical margins do not apply

Layout software offers the setting for body text. The setting is not meant for large display lettering, table cells or headlines.

How much to hang depends on the typeface

The amount to hang depends on the typeface. A typeface whose capital A, V, W and Y have vertical sides needs no outdent for those letters, although T and punctuation still benefit.

not hung“hung“
Look at where each line begins. When the quotation mark hangs in the margin, every line starts on the same edge.

052 min

Optical alignment in interface design

Interfaces bring the same effects, and designers meet them while building components.

Icons come first. In an icon set, round icons are drawn a little larger than square ones, and icons with a heavy side are shifted away from it. Google's design team described one case when it introduced its single-letter G icon in 2015. The icon was drawn on the same grid as the company's product icons. Its circular part was adjusted by eye to avoid a visual "overbite" where it meets the crossbar.

Text inside buttons

Text brings a hidden version of the problem. A browser adds space above and below every line of text. This is half-leading: the gap between lines, called leading, is split into two halves, one placed above the text and one below. That space does not match the height of the letters, so a button with equal padding on all sides can still show its label off-center. Developers fixed this by hand. They set padding of 5 pixels on the top and bottom and 10 pixels on the sides, then adjusted until it looked right.

Why hand-tuned padding breaks

Padding tuned by eye is fragile. The Chrome team warns that a value tuned on one device and operating system can look wrong on another.

Trimming the extra space

Chrome 133 added a CSS property, text-box, that trims this space. The setting text-box: trim-both cap alphabetic removes the space above the capital letters and below the baseline, which is the line the letters sit on. After that, equal padding such as 10 pixels looks centered.

Designers report the same adjustment in other places: the padding of icon buttons, the position of a dropdown menu under its trigger, and the start of text in a rounded input field.

061 min

Other shapes the eye misjudges

Overshoot, hanging and centroids are the corrections with the clearest published sources. Logo and interface designers list others. None has a single fixed value, and each is judged in the design at hand.

  • A triangle looks larger than a circle of the same height.
  • A vertical line looks longer than a horizontal line of the same length.
  • Thin strokes lose visibility sooner than bold shapes.
  • An object centered in a frame looks lower than it is, so designers place it a little higher.
  • A white shape on a dark ground looks heavier than the same shape in black on a light ground.
  • The same color can look different next to different neighbors, which changes how heavy the shape seems.
  • Words in capitals next to words in mixed case look larger, so designers reduce them slightly.
  • A centered word that begins or ends with an open letter such as T or L can look lopsided.

071 min

Applying optical alignment

Work through these steps in order.

  1. Align by measurement first. Most layouts need nothing more.
  2. Look for the shapes where measurement and sight disagree: triangles, circles beside squares, arrows, and text that starts with punctuation.
  3. Move a shape away from its heavy side, and draw a round shape a little larger than a square one. Keep each change small.
  4. Check the result three ways. Zoom out so the details blur. Flip the design horizontally. Put it on light and dark backgrounds.
  5. Where the same shape repeats, use a number instead of judgment. The area ratio, the centroid and CSS text trimming give the same answer every time.
  6. Write the offset into the component. If a triangle needs a 3.5 pixel shift, store it in the icon file, so the next person does not undo it with the align command.

If your team works on an 8-point grid, optical offsets are the exceptions. They let a few elements sit off the grid so the whole looks aligned.

081 min

When optical alignment goes wrong

Optical alignment fails in two ways.

The belief that only eyes can do it

Some designers say software cannot judge visual weight, so numbers are useless and everything should be dragged by eye. Edwards disagrees. He finds that approach too imprecise, and says the numbers can be relied on when the right calculation is used for the situation. Each of his formulas covers one kind of shape, so the practical view is to use a calculation where one exists and to use the eye to check it.

Changes that nobody records

A change made by eye and never written down can be undone. A teammate who sees a triangle 3.5 pixels off center may correct it with the align command, and the original problem comes back.

091 min

Optical alignment vs nearby ideas

Optical alignment is often confused with ideas that also adjust how things look. The axis that separates them is what each one decides.

IdeaWhat it decidesHow it differs
DesignKerningKerning applies the same by-eye judgment to spacing. Optical alignment also moves whole shapes and text edges.What it decides: The space between pairs of letters
DesignGrid systemsA grid sets positions by measurement. Optical alignment corrects the few elements that look wrong on the grid.What it decides: Where elements sit in columns and rows
DesignGestalt principlesGestalt explains what people see as a whole. Optical alignment corrects where a shape sits or how large it is.What it decides: How people group shapes and complete them, as in closure
Not in the library yetRule of thirdsIt is a composition guide for livelier layouts, not a correction for shapes that look off.What it decides: Where to place the main subject in a frame
Not in the library yetSquircle cornersIt changes the corner shape. Optical alignment changes position and size.What it decides: The outline of a card or button

?3 questions

Questions people ask

Is optical alignment the same as aligning lenses and lasers?

No. In engineering the term means positioning lenses, mirrors and fibers so light follows the right path. This entry covers the design sense: moving shapes and text so they look aligned.

Can software do optical alignment automatically?

In part. Formulas exist for area and triangle centers, layout programs hang punctuation, and CSS can trim text space. Unusual shapes and mixed contexts still need a person to judge the result.

How far should I move a shape?

Start small and check. A triangle in a circle moves about one sixth of its width, a circle is about 13% wider than a square of equal weight, and letters overshoot by 1% to 3%.

§10 sources

Sources

  1. Marc Edwards, Bjango, "Formulas for optical adjustments", 13 February 2023.

  2. Wikipedia, "Overshoot (typography)". (typography)

  3. Wikipedia, "Optical margin alignment".

  4. Google Design, "Evolving the Google identity".

Show all 10 sources
  1. Adam Argyle, Chrome for Developers, "CSS text-box-trim and text-box-edge", 14 January 2025.

  2. Logodesign.net, "The Designer's Secret: Optical Adjustments in Logo Design".

  3. Ian Paget, Logo Geek, "Optical corrections every logo designer should know about", 2016.

  4. Luke Jones, Marvel, "Optical adjustment: logic vs. designers".

  5. Framer, "Optical Alignment", web design dictionary.

  6. Gonçalo Dias, "Optical alignment", 20 November 2025.

Keep reading

More from Design

All of Design
All of Design

Missing a concept?

Tell us what to write next. We’ll email you when it’s live.

Several? Separate them with commas.

Only to tell you when it’s live.

How we use your email: privacy.