Money may not grow on trees, but it apparently does grow on marijuana plants. If all 50 states legalized cannabis today, they'd be collectively raking in more than $3 billion a year in taxes.

That's according to NerdWallet, a personal finance site, which forecasts a total $3.1 billion annual windfall for state governments that legalize the popular plant.

California would gain the most from legalization. NerdWallet projects the Golden State would generate more than $519 million per year, which the website points out would almost fund the entire 2013 budget for California's Department of Parks and Recreation. New York would be second, with $248 million, NerdWallet said. Seven additional states would bring in $100 million or more from legalization, and 25 others would stand to make at least $20 million per year.

NerdWallet's estimate assumed a flat, 15 percent excise tax on marijuana -- the same as Colorado's excise tax on recreational marijuana sales. NerdWallet added state and local sales taxes to that figure.

The site didn't subtract medical marijuana tax revenues in the 23 states that allow medicinal use of cannabis. The post-prohibition forecast also failed to calculate reduced government spending on law enforcement. In 2010, Harvard economist Jeffrey Miron estimated more than $8 billion in annual savings in law enforcement costs if marijuana were legalized.

To estimate marijuana sales in each state, NerdWallet used the widely cited Substance Abuse and Mental Health Services Administration's National Surveys on Drug Use and Health to find the number of marijuana consumers aged 25 and older. NerdWallet calculated the approximate number of pot users in each state, and applied the percentage to the U.S. population. It estimated the total U.S. marijuana market at $14 billion, as projected by Miron.

Of course, tax rates in states may vary wildly from NerdWallet's 15 percent assumption. And estimating a marketplace for a substance that has been banned and stigmatized may be fraught. In Colorado, where recreational marijuana is legal, recreational marijuana tax revenue has been far lower than predicted.

Still, recent studies have projected that the U.S. marijuana industry may reach $8 billion to to $10 billion in sales by 2018.

In 2012, Colorado and Washington state legalized recreational marijuana. Twenty-three states and the District of Columbia have legalized marijuana for medical use. In November, Oregon and Alaska voters will cast ballots on the legalization of recreational marijuana, voters in Florida will decide on a medical marijuana ballot measure, and Washington, D.C., voters will consider legalizing recreational marijuana possession and use.