Six types of hexagonal boron nitride are investigated by terahertz time-domain spectroscopy. The loss coefficient is shown to be linear with porosity, while variations in refractive index indicate the distribution of porosity within the structure. Pyrolytic boron nitride is demonstrated to be suitable as a terahertz optical material.