Why do crabs spit foam?

When we buy crabs, we always choose those that have hard shells and are actively producing a lot of white foam. What’s the reason behind this?

As we know, crabs are crustaceans that live in water, and like fish, they also respire through gills. However, the gills of crabs are different from those of fish. Instead of being located on the sides of the head, they consist of many soft, sponge-like gill filaments that grow on both sides of the body, covered by the hard carapace. When living underwater, crabs draw in fresh water from behind their bodies (dissolved oxygen in the water enters the blood vessels of the gills), which flows through the gills and is expelled from the mouth on both sides.

Although crabs often live in water, unlike fish, they frequently crawl onto land to search for food and can survive without drying out. This is because the gill filaments of crabs store a lot of water. Even when out of water, they continue to breathe just like they do underwater. However, if they spend too much time on land, the moisture in their gills is gradually lost due to prolonged exposure to air, causing the gills to dry out and making breathing difficult. At this point, they vigorously move their mouth and gills, inhaling large amounts of air from behind their bodies and expelling it from both sides of the mouth. Because they inhale excessive air, the gills have a larger surface area in contact with the air, causing the water and air stored in the gills to be expelled together, forming numerous bubbles. As these bubbles accumulate, they form a lot of white foam in front of the mouth, hence the term “active crab foam.”