Porosity is calculated is the ratio between the pore volume of a medium and its total volume, and it is expressed as n=Vv/Vt. The Vv refers to the pore or void's volume, and it can have air (Va) and Water (Vw).
Since porosity is inherently a fraction, it can be expressed as a number between 0 and 1, where a higher decimal indicates a higher level of porosity. As the level of porosity increases, the volume of the solids within the medium decreases, and vice versa. Porosity is also expressed as percentage by multiplying the fraction by 100. Hence, 0.2 porosity is equivalent to a 20 percent porosity.