Gecarcinus quadratus is found in mangroves, sand dunes, and rainforests along the Pacific coast from Mexico south to Panama.
[3][4] Previously it has also been reported from the Pacific coast of northwestern South America,[3] but in 2014 this population was recognized as a separate species, G.
[2][4] This nocturnal crab digs burrows—sometimes as long as 1.5 m (4.9 ft)[5]—in the coastal rainforests of Mexico and Central America, and is common along the coasts of Mexico, Costa Rica, Panama, and Nicaragua.
It lives in the forest for at least some of its adult life, but needs to return to the ocean to breed.
[2] It is largely herbivorous and consumes leaf litter and seedlings.