In Earth science, porosity refers to the empty spaces in a rock. If the grains in a rock are well sorted meaning they are almost all the same size, it will have higher porosity than a rock with grains that are poorly sorted. In this case, because the materials within the rock are of different sizes, the smaller particles fit into the gaps between larger particles, causing it to become less porous. Rock type affects porosity. Dolomites have the lowest and sandstones have the highest porosity. Crystalline rocks like granite have low porosity because there are tiny, long, thin cracks between individual mineral grains. Because sandstone has mineral grains that are large and don't fit closely together, this allows for larger pore spaces.