What do animals such as clams and oysters extract from the water to build their shells?

Animals such as clams and oysters extract calcium carbonate from the water to build their shells.

Animals such as clams and oysters extract calcium and carbonate ions from the water to build their shells. Specifically, they absorb these ions from the surrounding water through their gills. Once inside the animal's body, they combine to form calcium carbonate, the main component of their shells. The animal then secretes this calcium carbonate as a protective covering, gradually building up its shell over time.