A Sea of Salt
Anyone who has swum in the ocean knows it tastes salty, while the water in rivers and lakes does not. This is a curious puzzle. Rivers flow into the ocean, and rivers are not salty, so where does all the ocean's salt come from? The answer is a slow process that has been at work for billions of years, turning the seas into the vast salty waters we know today.
Rain, Rocks, and Rivers
The story of ocean salt begins with rain. As rainwater falls and flows over the land, it is slightly acidic. This mildly acidic water slowly wears away and dissolves minerals from rocks and soil, a process called weathering. The water picks up tiny amounts of dissolved minerals, including the substances that make up salt. This mineral-carrying water flows into streams and rivers, and the rivers carry it onward toward the sea.
Why the Salt Builds Up
Here is the key part. River water does contain dissolved minerals, but only in very small amounts, so rivers do not taste salty. When that river water reaches the ocean, the water itself eventually evaporates back into the air to form clouds and rain again. But evaporation leaves the dissolved salt behind. The water cycles away, the salt stays. Over millions and millions of years, river after river has delivered its tiny load of minerals, and because the salt keeps being left behind, it has gradually accumulated in the oceans.
Other Sources and a Balance
Rivers are the main source, but not the only one. Beneath the sea, water seeps into cracks in the ocean floor, gets heated by the Earth's interior, and dissolves more minerals from the rock before flowing back out. Underwater volcanic activity adds minerals too. At the same time, some salt is removed from seawater, as sea creatures use certain minerals and as salt settles onto the seafloor. Today the ocean's saltiness stays roughly steady, balanced between the salt coming in and the salt being removed.
Source
This article was written using information from Wikipedia.