Skip to content
Language:en

Sonar: distance by echo

Your phone clicks and listens for the echo: the delay gives the distance to a wall, like a bat.

Press Start and allow the microphone, face a large wall in a quiet room, raise the volume and press Ping.

Readings are processed on your device only: nothing is recorded or sent unless you export it.

Distance (median)
—
Echo delay
—
Echo strength
—
Measurements
—

Press Start, then Ping.

    Works best 1 to 10 m from a large hard surface. Each ping is a 4 ms sweep from 2 to 9 kHz.

    Runs entirely in your browser. Your files never leave your device.

    About this tool

    Bats, dolphins and submarines find obstacles by listening to echoes. Your phone can do it too: it plays a very short sweep through its speakers, records with its microphone, and looks for the reflection that comes back from a wall. Sound travels about 343 metres per second at room temperature, so a delay of 10 milliseconds means the wall is 1.7 metres away, half of the round trip.

    Stand facing a large flat wall, in a quiet room, between about 1 and 10 metres away, and press Ping several times: the page keeps the median of the measurements. Set the air temperature for a more precise speed of sound. It is an experiment rather than a tape measure, and furniture and corners also send echoes back.

    How it works

    1. Press Start and allow the microphone.
    2. Point the bottom of the phone at a wall, in a quiet room.
    3. Press Ping a few times.
    4. Read the median distance.

    Distance = speed of sound × delay ÷ 2, with c = 331.3 × √(1 + T / 273.15) m/s. The recording is compared with the sweep (matched filter), so each arrival becomes a sharp peak. Strong peaks are the direct sound, one per speaker; the echo is the strongest clear peak after them.

    Worked example

    Stand 2.5 m from a large flat wall in a quiet room and press Ping several times. The echo comes back after about 14.6 ms, and half of that round trip at 343 m/s gives 2.5 m. The median of five pings is usually within a few centimetres.

    Set the room temperature: at 30 °C sound travels at about 349 m/s, which shifts the result by nearly 2 %.

    Good to know

    • Face a bare wall; furniture, curtains and corners send their own echoes.
    • Keep the room quiet and hold the phone still while it listens.
    • Below about 1 m the echo overlaps the outgoing sound and cannot be separated.

    Frequently asked questions

    Why does it say no echo was found?
    The echo may be too weak or drowned in noise. Move closer to a large hard wall, raise the volume, and avoid soft rooms full of curtains and cushions.
    Why is there a minimum distance?
    The direct sound lasts a little while in the recording. Echoes from closer than about 30 cm arrive during it and are ignored.
    Does it work on phones with two speakers or Dolby Atmos?
    Yes. Stereo speakers and surround processing such as Dolby Atmos play the sound more than once, sometimes a few tens of milliseconds apart. Every strong burst is treated as direct sound, and the echo is measured from the burst just before it, so a second speaker is not mistaken for a far wall.
    Is anything recorded?
    The sound is analysed in memory for a fraction of a second and never stored or sent.