Why is the ocean salty?

The ocean did not become salty all at once. Water has been collecting and carrying dissolved substances for a very long time.
A journey from rock to river to sea
Rainwater contains a little dissolved carbon dioxide, making it slightly acidic. As it moves over and through rocks, it slowly weathers minerals. Rivers carry dissolved ions, including sodium and chloride, toward the ocean. These ions are too small to see and are not removed by ordinary filtration.
When ocean water evaporates, the water molecules enter the atmosphere. Most dissolved salts stay behind. Water also exchanges chemicals with rocks at the seafloor, and some dissolved substances are removed through biological and geological processes. Ocean salinity reflects these inputs and outputs.
Why are rivers usually much less salty?
Rivers are continually refreshed by precipitation and flow toward a larger body of water. The ocean is a vast reservoir in which many dissolved ions can remain for a long time. A typical ocean salinity is about 35 grams of dissolved salts per kilogram of seawater; it varies with evaporation, precipitation, freezing and freshwater input.
Make the connection
This connects the water cycle, weathering, solutions and concentration. Sea ice formation also leaves much of the salt in the surrounding water, affecting its density.
Explore the related unitIllustration or photograph provides context; use the explanation to understand the science.