Omnikit
DevFilesMoneyAll tools
Ctrl K
Dev toolsFile toolsMoney calculatorsAll tools
HomeFile toolsMeasure Distance with Sound

Measure Distance with Sound

files

Sonar in a browser tab: an inaudible chirp finds the nearest wall, to about 4 cm

Processed in your browser. Nothing is uploaded. Updated on 24 Oct 2026.

A phone can measure a room by playing an inaudible chirp and timing the echo, to about 4 cm. Useful when a tape measure is not to hand. What it needs is the microphone, a quiet moment, and a hard flat wall to bounce off.

Next:
  • Cut the audio Cut one or more pieces out of an audio file and save them separately or joined
  • Change the volume Make an audio file louder or quieter by an exact amount, with the clipping counted first

How to measure distance with sound

1

Press Check this device and allow the microphone; the page tests whether it can play and hear 18 to 20 kHz.

2

If it says This device can do it, press Take a baseline and keep still and quiet while the direct path is recorded.

3

Point the device at a hard flat surface such as a wall or door and press Measure.

4

Read the distance to the strongest reflector and its Confidence on screen, then press Stop.

About Measure Distance with Sound

This tool turns a laptop or a phone into a short-range sonar. A chirp sweeping from 18 kHz to 20 kHz, above what most adults can hear, is played through the speaker while the microphone records. The recording is compared with the chirp that was sent, the echo is found, and the delay is converted into a distance.

How it works

The arithmetic is the same as a parking sensor: distance equals half the round trip time multiplied by the speed of sound, 343 metres per second at 20 degrees Celsius. Three refinements make it work on hardware that was never designed for it.

Matched filtering: the recording is cross-correlated with the chirp. A chirp correlated against itself produces one sharp spike, so an echo far below the noise floor still appears as a peak. Baseline subtraction: the speaker sits centimetres from the microphone, so the direct path is hundreds of times louder than any echo and its ringing covers the beginning of the correlation. A baseline is captured first with the same chirp and subtracted, leaving what changed. And a guard distance: the first 25 centimetres are ignored entirely, because nothing there can be separated from the direct path.

Honest limits

Range is roughly three to four metres in a quiet room. The 2 kHz bandwidth of the chirp sets a resolution cell of about nine centimetres, which is the speed of sound divided by twice the bandwidth; interpolating the correlation peak narrows a single strong reflector to roughly four centimetres, but two reflectors closer together than the cell merge into one. Soft furnishings absorb 18 to 20 kHz almost completely, so a curtain, a sofa, a bed or a carpeted wall returns nothing measurable. Hard flat surfaces such as plaster, glass and doors work best.

Before starting, the tool checks that your device can actually produce and hear the band, because many laptop speakers roll off above 16 kHz and some microphones are filtered by their driver. If the chirp comes back no louder than the silence, the tool refuses to start rather than reporting confident nonsense.

Frequently asked questions

How does a browser measure distance with sound?

A chirp sweeping 18 to 20 kHz plays through the speaker while the microphone records. The recording is cross-correlated with the chirp, which turns a faint echo into a sharp peak, and the delay of that peak is halved and multiplied by 343 metres per second, the speed of sound in air at 20 degrees.

How accurate is it?

Roughly four centimetres for a single strong reflector within three to four metres, in a quiet room with a hard flat surface. The chirp's 2 kHz bandwidth sets a resolution cell of about nine centimetres, so two objects closer together than that merge into one peak and are reported as a single distance.

Why does it sometimes find nothing at all?

Soft material absorbs 18 to 20 kHz almost completely. Curtains, sofas, beds, carpet and clothing return nothing measurable, and neither does an open doorway. Point the device at a wall, a door, a window or a cupboard instead, and keep the room quiet, because a fan or a keyboard raises the noise floor the echo has to stand above.

Can I hear the chirp?

Most adults cannot. Sensitivity above 17 kHz falls with age for nearly everybody, so 18 to 20 kHz is silent to the majority of listeners. Children, teenagers and some adults hear it clearly as a faint tick or whine, and pets often react to it, so consider that before running it repeatedly.

Why does it need a baseline recording first?

The speaker is only centimetres from the microphone, so the direct path is hundreds of times louder than any echo and its ringing covers the start of the correlation. Capturing a baseline and subtracting it removes that fixed signature and leaves only what changed, which is the reflection you are looking for.

Why did the tool refuse to start on my device?

Many laptop speakers roll off above 16 kHz and some microphones are filtered by their driver, in which case there is nothing in the band to correlate. The check compares the chirp with silence, and if it is not at least six decibels louder the tool stops rather than reporting confident nonsense.

Still stuck? Ask about Measure Distance with Sound and anybody who knows can answer. No account needed.

Also works as: Sonar Distance Measure · Ultrasonic Tape Measure · Measure a Room with Your Phone.

Same job, other tools: Fix Audio in One Ear – Recording only plays in one earbud? Make it mono so both ears hear it · Hz Generator – Type a frequency in hertz and hear it, from 20 Hz to 20,000 Hz · Mic Test – See your voice on a live waveform and hear it played straight back.

On the related tools: Increase Audio Volume – Raise a quiet recording as far as it will go before anything starts to distort.

Related tools

All file tools
Stereo to Mono ConverterMix stereo audio to mono, keep only the left or right channel, or swap the sidesVolume ChangerMake an audio file louder or quieter by an exact amount, with the clipping counted firstAudio EditorCut, delete, speed up and join audio on one timeline, in your browserTone GeneratorPlay a sine, square, triangle or sawtooth tone at any frequency, or sweep between twoSound Level MeterMeasure noise with your microphone: live dB, plus minimum, maximum and averageSpeaker and Mic TestCheck both speakers and your microphone before a call, in under a minuteHearing ScreeningA rough chart of which tones you could hear, one ear at a time. Not a testRoom Echo Test (RT60)Clap once and find out how echoey your room is, and what to do about it

In the collection Audio Test Tools.

Was this tool helpful?
Omnikit

Small jobs, done in your browser. Free, fast and private. Files are never uploaded.

Files

  • Compress Image
  • Image to PDF
  • Merge PDF
  • Compress PDF
  • PDF to Word
  • Word to PDF

Dev

  • JSON Formatter & Validator
  • Base64 Encode & Decode
  • JWT Decoder, Verifier & Encoder
  • Password Generator
  • UUID Generator
  • Unix Timestamp Converter

Money

  • SIP Calculator
  • EMI Calculator
  • GST Calculator
  • FD Calculator
  • PPF Calculator
  • Lumpsum Calculator
GuidesQuestionsAboutHow we checkLaw library (beta)PrivacyTermsDisclosureContactMore: Exam practice (UGC NET Paper 1)Runs in your browser. Nothing is uploaded. © 2026 Omnikit (theomnikit.com)