The Sunshine State is Uncle Sam's favorite.

Florida receives more federal funds than any other state, both in total dollars and on a per capita basis. In fact, based on total volume, Florida's take is 50 percent higher than No. 2 Texas.

According to an analysis by CNBC.com, Florida received $577.8 billion in the 2011 fiscal year, or a whopping $30,318 per capita. Rounding out the top five in per-capita payouts were Louisiana, South Carolina, Hawaii and Virginia.

The analysis included federal money used for government operations — distributed both to government agencies and contractors — as well as money for entitlement programs like Social Security, unemployment compensation and food stamps.

Most of the biggest awards Florida received came through Homeland Security, the umbrella organization for everything from FEMA to port and airport security. Other large awards came through the Social Security Administration and the U.S. Department of Health and Human Services, which oversees Medicare and Medicaid, among other duties.

Among contractors in-state receiving large federal awards were telecommunications company Harris Corp. and several aerospace and defense companies, notably Lockheed Martin, Raytheon, General Dynamics and Northrop Grumman.

With about 19 million residents, Florida is the fourth-largest state. The biggest state, California, has nearly twice as many residents but received only the third-highest amount of federal dollars.

Texas was No. 2 but trailed far behind Florida with a total take of $294 billion. With nearly 26 million residents in Texas, that translates to $11,452 per capita.

Total federal spending for fiscal year 2011 is estimated to be $3.6 trillion, according to the Office of Management and Budget's 2012 Mid-Session Review. CNBC's report used data from USASpending.gov, an Office of Management and Budget website,