If you get into folk stories and mythology you will see that almost every culture has a story explaining how the oceans became salty. The answer is really very simple. Salt in the ocean comes from rocks on land.
Here’s how it works:
The rain that falls on the land contains some dissolved carbon dioxide from the surrounding air. This causes the rainwater to be slightly acidic due to carbonic acid (which forms from carbon dioxide and water). The rain erodes the rock and the acid breaks down the rocks and carries it along in a dissolved state as ions.
The ions in the runoff are carried to the streams and rivers to the ocean. Many of the dissolved ions are used by organisms in the ocean and are removed from the water. Others are not used up and are left for long periods of time where their concentrations increase over time.
The two ions that are present most often in seawater are are chloride and sodium. These two make up over 90% of all dissolved ions in seawater. By the way, the concentration of salt in seawater (salinity) is about 35 parts per thousand. In other words, about 35 of 1,000 (3.5%) of the weight of seawater comes from the dissolved salts; in a cubic mile of seawater the weight of the salt, as sodium chloride, would be about 120 million tons. And, just so you don’t think seawater is worthless, a cubic mile of it also can contain up to 25 tons of gold and up to 45 tons of silver! Before you go out and try alchemy on seawater, though, just think about how big a cubic mile is.
By some estimates, if the salt in the ocean could be removed and spread evenly over the Earth’s land surface it would form a layer more than 500 feet (166 m) thick, about the height of a 40-story office building.