Follow these steps when laying out the site for your deck so the posts are in line and the corners are perfectly square.
Laying out a site so the posts are in line and the corners are perfectly square relies on the simplest of homemade tools -- batterboards. You'll need two batterboards for each corner (unless you can't drive batterboards close to the house). Make them from 2-foot pointed 1x2 or 2x4 legs and an 18- to 36-inch 1x4 crosspiece.
Start your layout by driving batterboards perpendicular to each other and about 3 feet beyond the outside corners of the site where you have removed the sod. String mason's line tightly between them and fine-tune the batterboards so the crosspieces are at the same height. Drive in the legs so the crosspieces are level (check them with a torpedo level).
Then follow the steps illustrated on this page to lay out an attached deck, beginning by plumbing the ledger location to establish the center line for the outside posts. If you're laying out a freestanding deck, you won't have a ledger as a guide but the rest of the steps will be the same.
About six hours for a 12x16-foot deck, excluding sod removal and preparation
Tape measure, cordless drill, small sledge hammer, plumb bob, mason's line, line level, wooden stakes
Measuring, leveling, driving stakes, making simple calculations
Prep Remove sod
Scrap 2x4s and 1x4s, deck screws, masking tape, landscape spikes
Tack a nail on the ledger at your post centerline and drop a plumb bob from it. Drive a batterboard close to the house with its crosspiece level, centered on the plumb bob, and level with the batterboards on the outside corner. String a line to the outer batterboard and level it with a line level.
Let the plumb bob come to rest and pencil-mark its location on the crosspiece. Drive a small screw near the mark and wrap the mason's line around the crosspiece, lining it up with the mark on the last wrap. Repeat the layout of the post centerline on the other side of the site.
Drop a plumb bob with its line just touching the intersection of the mason's lines. Let the plumb bob come to rest and have a helper mark its location on the ground with a landscape spike. Remove the plumb bob and drive the spike into the ground. Mark the spikes with painted Xs.