A dispensing device dispenses drinks or similar dosable liquid foodstuffs, especially coffee, milk, soft drinks or soups. The dispensing device includes an identification device for identifying a vertical height of a container for receiving the foodstuff and for emitting a height signal, a filling device which can be arranged in such a way that the height thereof can be adjusted in relation to the container, and a control device which sets the filling device to a pre-controllable filling level in relation to the container, on the basis of the height signal, before the foodstuff is introduced into the container. In this way, a container can be filled in an optimum manner without spilling.