The total market cap figure for the US at any given time is available in two places. The first is the Federal Reserve's "B.102 Balance Sheet of Nonfinancial Corporate Business" from the Z.1 release, specifically line 36 for "Nonfinancial corporate business; corporate equities; liability." The second is the St. Louis Fed's FRED data set "Nonfinancial Corporate Business; Corporate Equities; Liability, Level (MVEONWMVBSNNCB)," also from the Z.1 release. They both reveal the same number for market cap in 2013 Q4: US$21.36T. The GDP is found in the BEA's news releases. That figure for 2013 Q4 is US$17.08T. Divide market cap by GDP and the ratio is 125.1% for the final quarter of 2013.
Knowing the construction of this ratio is not as useful as knowing whether it indicates a true valuation. A Google search of this metric reveals that most of the financial press is guessing where the upper and lower bounds of this ratio belong. Does 125% mean overvaluation? Does 50% mean undervaluation? There's little time series data showing where this ratio stood in comparison to its long-term average because Wall Street is too lazy to find it. I can't find a reputable source that even calculated the ratio's long-term average. Keep reading if you want to see my awesome solution.
The metric may be more useful as a comparison across geography rather than time. The World Bank helpfully publishes the market cap to GDP ratio for many countries as series CM.MKT.LCAP.GD.ZS from its Financial Sector featured indicators. The data for multiple countries leads me to some intriguing observations. I looked at my preferred currency hedge countries: Australia, Canada, and Switzerland. Canada's ratio is pretty close to the US ratio as of 2012, the latest year for which data is displayed. Switzerland's ratio is much higher, and Australia's is somewhat lower. I am tempted to conclude that Australia's equity market was undervalued recently but that makes little sense as its currency was very strong in 2012. Perhaps this ratio is just one of many metrics for international investors to display in a dashboard as they consider geographic diversification.
I downloaded the World Bank's entire multi-year, multi-country data set in MS Excel format. This enabled me to calculate the long-term average ratio for the US, from 1988-2012, as 105.9%. There are other group categories in the data set that allow for comparisons. I selected the line for all "OECD members" and found the 1988-2012 average is 81.3%. It is intriguing to see that the US's market cap trades at a premium to the OECD aggregate over the long term. I wonder if the US's economic freedom and political stability confer structural advantages that entice investors to bid up its total market cap. It's hard to draw such a broad conclusion from only one metric. Other analysts are free to make their own country comparisons to the various regional aggregates.
Warren Buffett makes investments in companies that trade at a discount to their intrinsic value. He dropped an offhand comment about how a country's market cap compares to its GDP and the financial press jumps on it as some kind of concurrent indicator. I must be more circumspect in my own judgment of this valuation indicator. Consider that this ratio absolutely cratered in 2008 for the US, dropping to 79.7% by the World Bank's data. It stood at 104.5% in 2009 even though the US economy was still feeling the effects of the global financial crisis. This metric is most useful in a time series that compares the US to its competitors and to global aggregates. It is not some "fire and forget" trigger for action by itself.