Assuming a 4:12 pitch, you would need a rafter that is 6 feet 3 inches long. However, If you want to consider other pitches, you can use the rafter length formula in terms of the pitch and run:
rafter length = run√(pitch2 + 1)
Remember that the span equals twice the run, so run = span / 2. Read more