1. TOS-era: The Original Series The original series warp equation is generally accepted to be:
v = (W ^ 3) * c
But this has never appeared in any episode. However, it has such wide acceptance that it has pretty much stuck. It’s even in the Encyclopedia.
Boris S. writes:
The equation is almost certainly the work of TOS producers. Stephen Whitfield extensively researched the show in the period of 1967-68 and published the information in his book The Making of Star Trek (1968). He states that Warp 1 is the speed of light, Warp 3, 24 times the speed of light, Warp 6, 216c and Warp 8, 512c. With the exception of the value for Warp 3 (which should be 27c), the W^3*c formula holds. Whitfield almost certainly obtained the numbers from the TOS writer’s guide which contained a small technical manual.
This chart compares TOS-era Warp speeds with the speed of light:
Warp Factor Velocity 1 1 Speed of Light 2 8 3 27 4 64 5 125 6 216 Maximum stable speed of NCC-1701 7 343 8 512 Emergency speed of NCC-1701 9 729 10 1000 11 1331 12 1728 13 2197 14.1 2803 "That Which Survives" [TOS]
It is also generally accepted that the TOS scale was also used for the first few movies. Since speeds are rarely quoted in the movies, however, that’s only speculation.
Joe Chiasson, describing Star Trek Maps, a map and manual combination by Bantam Books from 1980, offers:
The booklet contains quite a lot of written information on the development of warp drive systems and how warp travel is affected by matter density in a given area of space. The above formula was written as v = Wf^3 * c. This was further modified to include the Greek letter chi (X), which was a variable denoting the local density of matter, which changed depending on where you happened to be. So the proper formula for TOS level warp drive is
v = c * Wf^3 * X
where Wf was the warp factor, and c was the speed of light. Included was a table of corrected warp speed for a given average value of X.
This correction factor does make a lot of sense, given that v = W ^ 3 by itself is almost ludicrously slow given the speeds quoted by TOS. Joe also suggests that by the time of TNG warp fields have been refined to the point that the chi factor is dropped from the formula. I think that the numbers are a little too high, however, when compared to TNG speeds.
As a side note, wf(n) = n * c appears in James Blish’s TOS script adaptations, which have been widely read, so you may see that formula cropping up from time to time as well. Those speeds would be ridiculously slow, so that formula isn’t really worth considering. (Thanks to Taki Kogoma for pointing that out.)
John "Eljay" Love-Jensen points out that in "By Any Other Name" [TOS] the Kelvans were using there technology to propel the Enterprise "to Andromeda, 300 years of travel". Andromeda is 2.3 million light-years away. For 300 years of travel, that translates into Warp 19.7! They probably intended to accelerate to that speed once they made it outside the galaxy, and the Enterprise didn’t end up going that fast during the episode, but it means they thought it was possible for the ship to make it.