It is an annoying distraction to be riding your bike and your handlebars are not quite square with the front wheel. They seemed to be square when you assembled the bike, but as soon as you ride it you can tell they are off a little.
Back in March, 2007 I posted this little tip for aligning handlebars: Hold the square end of a twelve-inch steel ruler against the center ferule of the handlebars, this gives you the long edge of the ruler to sight up with the edge of the front tire. (See above picture.)
I used my “Old Skool” bike as an example, but what if you have a modern 1 1/8 inch steerer, and stem. Often the front of the stem cap is machined square, so you can still use the straightedge method. Just place the ruler on the stem cap, instead of the bars which may be tapered.
However, there is another way that doesn’t require a straightedge.
Turn your front wheel at an angle, then closing one eye and sighting from above, sight the front and rear of the stem to center on the front tire. (See picture above.)
Stand straight and with one hand on the nose of the saddle, and the other on handlebars; lean the bike towards you, rather than try to position your head above the bike.
In other words move the bike to line up with your eye, rather than the other way around. Make sure the brake cables are tucked under the stem, so they don’t interfere with your line of vision.