How many solar panels fit on my roof?
Measure each roof plane that faces south, east or west: the length of the eave, and the depth from the eave to the ridge as seen from above (a satellite map works). The planner converts that depth to the true sloped length using the pitch, takes off the setbacks, and tries both portrait and landscape to fit the most modules. A typical 400 W module is about 68" x 45", or roughly 21 sq ft.
Fire-code setbacks
The International Residential Code (section R324.6) requires at least two 36"-wide pathways from the eave to the ridge, on separate roof planes, so firefighters can get on the roof. It also requires a clear setback on both sides of a horizontal ridge: 18" when the arrays cover no more than 33% of the plan-view roof area, or 36" above that. With fire sprinklers, the 18" setback applies up to 66%. Roofs of 2/12 or flatter are exempt. Many cities amend these rules, so check with your building department.
How much power will it make?
A simple estimate: system size in kW x peak sun hours x 365 x 80%. The 80% accounts for wiring, inverter, heat and dirt losses. A 7.2 kW system in a 4.5-hour area makes roughly 9,500 kWh a year. For a precise number for your address, tilt and direction, use NREL's free PVWatts calculator.
How many panels do I need?
Add up a year of electric bills in kWh (or multiply a typical month by 12), then divide by what one panel makes in a year. At 4.5 sun hours, a 400 W panel makes about 525 kWh a year, so a home using 900 kWh a month needs about 21 panels to cover all of it.
Racking
Most roof systems run two rails under each row of panels, fastened to the rafters with flashed mounts. Spacing depends on wind and snow loads; 48" on center is common, but the installer's engineering sets the final number. Mid clamps join neighboring panels, and end clamps hold the ends of each row.
Sources: NREL PVWatts. Re-roofing first? Estimate shingles with the roofing calculator.