An altimeter does not actually measure altitude directly, but rather just atmospheric pressure. So an altimeter is actually a barometer created for a specific purpose. The altimeter uses the changes in atmospheric pressure to determine the changes in altitude. Why does pressure change with altitude? Simply put, the pressure at any given point in the atmosphere around the earth is a result of the weight of the atmosphere above it (pulled down by gravity). For this reason, the higher in the atmosphere you are, the less atmosphere you have above, and the less pressure exerted on you.