Here's a bit more detail:
* Sand is made up of rock and mineral fragments that are between 0.0625 millimeters and 2 millimeters in diameter.
* These sand grains are transported by wind, water, or ice, eventually settling in a location.
* Over time, the sand grains are buried under more sediment.
* The weight of the overlying sediment and the pressure of fluids within the sediment cause the sand grains to compact together.
* Dissolved minerals in the fluids precipitate out between the sand grains, acting as a cement that binds them together. This process is called diagenesis.
The type of sand that forms the sandstone will determine its composition and properties. For example:
* Quartz sandstone is formed from sand grains that are mostly composed of quartz.
* Arkose sandstone contains a significant amount of feldspar grains.
* Greywacke sandstone is a mixture of quartz, feldspar, and rock fragments.
So, while the answer is "sand," the specifics of the sand composition influence the type of sandstone that is formed.