An interactive tank with a level transmitter loads here. It needs JavaScript; the sections below explain everything it shows.
The simplest level gauge is a glass tube or a window joined to the tank at top and bottom, so the liquid in the glass stands at the same height as in the tank. A boiler's gauge glass works this way. Tanks without one are measured by sounding: lowering a weighted tape down the sounding pipe and reading where it comes out wet.
A float rides on the surface and moves an arm, a magnet or a switch. Moving a magnet past reed switches gives a reading in steps; tipping a switch gives an alarm at one level.
The pressure at the bottom of a tank depends on how much liquid is above it: pressure equals the height times the liquid's density times g. Measure that pressure and you know the height, as long as you know the density. Get the density wrong and the reading is wrong in proportion: a transmitter set up for fresh water, reading a tank of oil at 850 kg/m³, shows the level 15% low. A pressure transmitter at the bottom, or a differential one between bottom and top in a closed tank, does exactly this.
A bubbler does the same from above: air is blown gently down a pipe to the bottom of the tank, and the pressure needed to push bubbles out of the end equals the liquid's pressure there.
A transmitter at the top of the tank sends a pulse down, and times how long the echo takes to come back from the surface. Distance is speed times time, halved for the trip down and back, and the level follows from the tank's height.
A small tuning fork is kept vibrating at its natural frequency. When liquid covers it, the vibration changes and the switch operates. With no moving parts to stick, it makes a reliable high or low level switch.