Alabama ranked 2nd most likely state to survive an alien invasion: Who beat us?

Imagine a time when spaceships suddenly appear in the sky, and hostile aliens start to pummel the planet. People in Alabama will have several advantages if they’re faced with extraterrestrial foes — think “Independence Day” meets “Sweet Home Alabama” — and the state is well poised to hold its own against rampaging creatures from outer space.

This, at least, is the conclusion drawn by GIGACalculator, a website that offers online calculators to help users with everyday math problems and statistics. A recent study from the company ranked Alabama as the second most likely state in the U.S. to survive an alien invasion.

We’re not just talking about grit and gumption here, although the Yellowhammer State has plenty of both.

To come up with its rankings, GIGACalculator looked at factors such as the number of UFO sightings in each state, access to food and water, the number of medical professionals and scientists, military presence, population density and places to run and hide. (Caves were considered desirable for that, along with forested areas.)

All 50 states were given survival scores based an analysis by GIGACalculator, and Alabama earned a 7.91 out of 10. (See all the data here.)

A press release from the company points to Alabama’s “varied geography, from Appalachian foothills and mountains to beaches and valleys, and great hiding spots with its 35 caves, 0.71% of the area covered by forest and 0.03% covered by water.”

RELATED: What cities have reported the most UFO sightings in Alabama?

Good to know, of course, but who beat us? And what makes that state better at resisting a full-scale alien attack?

Virginia took the top spot in the rankings, with a survival score of 8.06 out of 10. The state tipped the scales with its military strength, the press release says, and its history of producing presidents.

“The state has the third most military members with 17 per 1k population, it is also the ninth most forest-covered state, with 0.63% of the state hidden by forest to take shelter,” GIGACalculator says. “Virginia is known as the ‘Mother of Presidents’ with eight U.S. presidents born here, providing potential insider knowledge of extraterrestrial life in the event of an invasion.”

Massachusetts was ranked as No. 3, with a score of 7.81 out of 10. Big brains can be found there, GIGACalculator says, and that makes a difference when you’re fighting ETs.

“The state is home to some of the brightest minds in America with Harvard, and MIT students filling the streets, so it is no surprise that the state employs 72,590 scientists (10 per 1k people),” the press release says. “0.26% of the state is covered by water, the fourth highest in the US making it a perfect place to top up on hydration or escape in hopes that aliens can’t swim. The state is armed with the third most law enforcement employees per 1k people at 3.”

New York, Minnesota, Florida, Wisconsin, North Carolina, Alaska and Georgia rounded out the top 10, in that order.

Coming in dead last: Nevada, with a bottom-barrel score of 5.28 out of 10.

“The vibrant entertainment of Vegas offers little protection, with 75% of its land classified as desert, the state offers various climates but its popular city Las Vegas has a subtropical hot desert climate which many would struggle to survive if hit with an invasion,” GIGACalculator says.

Idaho and Arizona also have disadvantages if aliens invade, with scores of 5.71 and 5.77, respectively.

It’s interesting to note that a visit from peaceful extraterrestrials wasn’t considered in the study, which leans more toward the rampaging armies of “War of the Worlds” than the cerebral voyagers of “Arrival.”

Still, GIGACalculator gives Alabama a big thumb’s up, if and when those spaceships arrive.