Sonar is typically a technique that uses sound broadcasting and receiving equipment (usually underwater, but also through the air, or even in the earth) to navigate, measure distances (acoustic location), communicate with and/or detect objects.
Nevertheless, sonar can refer to passive sonar or active sonar. Passive sonar means listening for the sound made by objects, and active sonar means producing pulses of sounds and listening for the echoes of those.
People generally use sonar to detect objects and their distances on or under the surface of the water, such as the presence of vessels, submarines, or shoals of fish.
In addition, people also use the sounds they hear with their ears to measure distances (for instance, the distance to a party, to commotion, or to lightning), or to locate an object, people, or animals, and so on, which is a type of passive sonar ability.
Certain animals, such as dolphins, whales, and bats, use so-called echolocation through emitting sound and listening to the echo that returns from various objects near them. This ability is also called biosonar. They use this for navigation, communication, foraging, and hunting prey.