This is an online calculator for joist and rafter spans. It takes into account wood species, size and grade, defelction linits, spacing, loads, etc. It's a marvelous tool and all the more because it is free for use. http://www.awc.org/calculators/span/calc/timbercalcstyle.asp
NOTE: This is a wonderfully handy calculator. I like it better than the tables that can also be used. Like the simple tables the rafter solutions are for rafters with the rafters ties or ceiling joists located at the rafter to wall joint
. If the rafter ties are elevated corrections must be applied to the rafter sizes. The corrections may be found in the building code tables.