Ultrasound Distance Calculator – Distance from Echo Time (Sonar & Sensors)
Use this free Ultrasound Distance Calculator to find how far away an object is from the time its echo takes to return. This is exactly how sonar, parking sensors, medical ultrasound scanners and bats measure distance.
Shout at a cliff and time the echo, and you can measure the distance to the cliff. This calculator is that idea, industrialised: a device emits a short pulse of ultrasound — sound pitched far above human hearing — and times how long the echo takes to return from whatever the pulse struck. Halve the travel time (the pulse went there and back), multiply by the speed of sound in the medium, and the distance falls out: d = v × t / 2. Sonar on ships, parking sensors on cars, scanners in hospitals, level gauges in fuel tanks and the navigation system of every bat all run on this one division.
The division by two is the soul of the method and the source of its commonest error. The stopwatch measures a round trip: pulse out, reflection, echo home. The object is only halfway through that story. Everything else is choosing the right speed. Sound travels at 343 m/s in air, 1,480 m/s in water, about 1,540 m/s in soft body tissue and 5,960 m/s in steel — a seventeen-fold spread that turns the same echo time into wildly different distances. The calculator's medium menu encodes the standard values, with a custom option for tissue, seawater, or any material whose sound speed you know.
Why ultrasound rather than ordinary sound? Three reasons, all physical. High frequencies travel in a tight beam instead of spreading in all directions, so the pulse interrogates one spot. Their short wavelengths — millimetres — reflect from small objects that long waves would flow around. And they are silent to us, so sensors can ping continuously without driving everyone mad. The trade-off is range: air absorbs ultrasound quickly, so airborne devices work over metres, while water carries sonar pulses for kilometres. The calculator does not care — give it a speed and a time and it returns the distance, from a parking sensor's 17 centimetres to a depth sounder's kilometres.
Formula
Distance d = v × t / 2 • total path travelled = v × t = 2d • rearranged: t = 2d / v and v = 2d / t
The formula is distance = speed × time with one correction: the timed journey is twice the wanted distance. The rearrangements earn their keep in design work. t = 2d/v predicts the echo time a given target will produce — a parking sensor's electronics must be listening at t = 2 × 0.17/343 ≈ 1 ms for an obstacle at 17 cm. And v = 2d/t turns the device into a sound-speed meter: time the echo from a wall at a measured distance and you have measured the speed of sound in that medium — the standard laboratory method, and the way tissue and seawater sound speeds in the menu were themselves established. Timing precision sets distance precision: an error of 1 microsecond in t is 0.77 mm in tissue (1540 × 10−6/2) but only 0.17 mm in air — one reason medical imaging, working in microseconds, resolves sub-millimetre structure.
| Symbol | Meaning | Units |
|---|---|---|
| d | distance to the reflecting object (the answer) | m |
| v | speed of sound in the medium | m/s |
| t | echo return time — out and back | seconds (s) |
Echoes, reflection and the blind zone
A pulse reflects when it meets a boundary between materials of different acoustic character — air to wall, water to seabed, tissue to bone. Part of the energy bounces back (the echo the sensor times), part continues onwards. Hard, dense boundaries in a light medium reflect strongly, which is why a wall returns a crisp echo to a parking sensor while a hedge, soft and airy, returns a whisper. The returning echo is always much weaker than the pulse — it has spread on the way out, reflected partially, and spread again on the way back — so receivers are built sensitive, and the timing is taken from the echo's leading edge, the first returning energy, which corresponds to the nearest point of the target.
Every echo ranger also has a blind zone. While the transducer is still ringing from emitting its pulse, it cannot hear; an object so close that its echo returns during the ringing is invisible. For a typical parking sensor the blind zone is a few centimetres — one reason they specify a minimum range around 15–25 cm rather than zero. At the other extreme, maximum range is set by absorption and spreading: the echo from a distant target sinks below the noise. Between those limits the method is beautifully linear — twice the time, twice the distance — and the calculator's simple formula is exact. Pulse length sets a third limit, resolution: two objects whose echoes overlap in time merge into one return, so short pulses and high frequencies (which allow short pulses) resolve finer detail — the same trade-off that puts medical scanners at megahertz and ship sonar at kilohertz.
How to use
- Choose the medium the pulse travels through — air, water or steel — or pick "Custom speed" and enter your own value (1,540 m/s for soft body tissue, about 1,530 m/s for seawater).
- Enter the echo return time in seconds — the full out-and-back time your sensor measured, not half of it.
- Click "Calculate Distance" to get the distance to the object in metres, along with the total path the pulse travelled as a check.
- Sanity-check the order of magnitude: in air, 1 ms of echo time means about 17 cm; in water, 1 ms means about 74 cm. If your answer is far from the scale your application expects, the medium is probably wrong.
Worked examples
Example 1 — the ship's sonar. A ship's sonar sends a pulse into water (v = 1,480 m/s) and the echo from the seabed returns after 0.1 s.
d = 1,480 × 0.1 / 2 = 148 / 2 = 74 m.
The water is 74 metres deep at that point.
Example 2 — the parking sensor. In air, an echo returns after 0.001 s (1 ms).
d = 343 × 0.001 / 2 = 0.17 m — an obstacle 17 cm behind the car, deep in the urgent-beeping zone. The sensor repeats this measurement many times a second to track the gap closing.
Example 3 — the bat. A bat's cry echoes from a moth after 0.02 s in air.
d = 343 × 0.02 / 2 = 3.43 m. The bat updates this ranging continuously as it closes in, timing its interception to the final millisecond — echolocation is this formula running on biological hardware, tens of times per second.
Example 4 — the medical scan. In soft tissue (custom speed 1,540 m/s), an echo returns after 0.00013 s (130 µs).
d = 1,540 × 0.00013 / 2 = 0.1001 m ≈ 10 cm — a structure 10 cm inside the body. A scanner fires thousands of such pulses along neighbouring lines and assembles the echo map into an image, one timed return at a time.
Example 5 — the hidden crack. An ultrasonic flaw detector tests a steel plate (v = 5,960 m/s); an unexpected echo returns after 0.00002 s (20 µs).
d = 5,960 × 0.00002 / 2 = 0.0596 m ≈ 6 cm — a crack or void 6 cm below the surface, found without cutting the plate open. The expected echo from the back face arrives later and confirms the plate's thickness.
Example 6 — the deepest ocean. A survey ship above the Mariana Trench receives its echo after 14.8 s.
d = 1,480 × 14.8 / 2 = 10,952 m ≈ 10.95 km of water below the keel — close to the known depth of the Challenger Deep, measured with a stopwatch and this division.
Echo ranging in real life
Depth sounding and charting. Every ship's echo sounder is Example 1 automated, pinging continuously so the chart and the alarm always know the clearance under the keel. Survey vessels map whole seabeds this way, line by line.
Medical imaging. Ultrasound scanners build pictures from thousands of timed echoes, using 1,540 m/s as the assumed tissue speed. Structures are located by exactly this formula — which is also why fatty tissue, whose true speed is lower, can shift apparent depths slightly.
Parking sensors and robotics. Bumper sensors, warehouse robots and cheap rangefinder modules (the hobbyist HC-SR04 is the famous one) measure air echo times in microseconds and convert with 343 m/s — the same calculation, at pocket-money prices.
Non-destructive testing. Rails, pipelines, pressure vessels and aircraft parts are scanned for hidden cracks by timing echoes from internal boundaries, as in Example 5 — flaws found by arithmetic before they can fail.
Tank and silo level gauges. A sensor at the top times the echo from the liquid or grain surface below and reports the level — and hence the contents — without touching the material, in chemicals too corrosive for floats.
Animal echolocation. Bats, dolphins and oilbirds run this computation neurally. Dolphins, working in water at 1,480 m/s, resolve timing differences fine enough to distinguish objects centimetres apart at tens of metres — performance engineers still admire.
Choosing the frequency: range versus resolution
Every echo-ranging device picks its frequency by trading two enemies. Absorption rises steeply with frequency, especially in air: a 40 kHz parking-sensor pulse fades within metres, while a 1 kHz ship's sonar ping can cross an ocean basin. Resolution pulls the other way: the smallest detail a system can separate is about one wavelength, and the shortest pulse it can make is a few cycles — at 40 kHz in air, λ = 8.6 mm and centimetre resolution is natural; at 5 MHz in tissue, λ = 0.31 mm and the scanner distinguishes sub-millimetre layers. Hence the landscape of devices: long-range sonar at kilohertz with metre resolution, fish-finders in between at hundreds of kilohertz, medical imaging at megahertz with millimetre resolution over centimetre ranges, and flaw detectors at megahertz in steel, where absorption is low and ranges are short. The distance formula never changes; the frequency choice decides what the formula gets to measure.
Multiple echoes and ghost targets
Real scenes rarely return one clean echo. A pulse may bounce wall-to-wall before coming home, arriving late and impersonating a farther object — a ghost target. Two surfaces at similar ranges return overlapping echoes that the receiver may merge or mis-time. Working systems defend themselves the same way everywhere: they trust the first returning echo (the shortest path is the direct one), they gate out returns that arrive implausibly early or late for the scene, and they compare successive pings, since real objects persist while ghosts flicker with geometry. When you use this calculator on a measured time, it is worth asking which echo the time came from — the formula converts faithfully, but it cannot know whether the stopwatch was started by the target you meant.
Quick reference: echo times for standard distances
| Situation | Distance | Echo time t = 2d/v |
|---|---|---|
| parking sensor, air | 1 m | 5.83 ms |
| echo sounder, water | 100 m | 0.135 s |
| medical scan, tissue | 10 cm | 130 µs |
| flaw detector, steel | 10 cm | 33.6 µs |
Read the table as a timing budget: whatever your application, the electronics must resolve times on the row's scale — milliseconds for bumpers, microseconds for bodies and steel.
From one distance to an image: how scanning is built
A single pulse gives a single number — but fire pulses in many directions and the numbers assemble into pictures. The simplest instrument, the A-scan, plots echo strength against time along one line: each peak is a boundary, and its position on the time axis is its distance by d = vt/2. Sweep that line sideways — mechanically, or electronically across an array of elements — and paint each echo as a bright dot at its computed depth, and you have the B-scan: the cross-sectional image of a medical ultrasound. Modern scanners steer the beam without moving parts, firing array elements with microsecond delays so the pulses add up along a chosen direction (a phased array), then listen with the same delays to focus the echoes. Nothing in the physics changes at any stage — every pixel of every ultrasound image is this calculator's division, with the machine performing it millions of times per second and remembering where each answer belongs. Even the image's depth scale is a confession of the method: the centimetres down the side of a scan are echo microseconds, converted at 1,540 m/s.
Common mistakes
- Forgetting to divide by two. The classic. The stopwatch times a round trip; d = vt without the /2 doubles every distance. If your seabed comes out at 148 m in a harbour charted at 74 m, this is why.
- Using the air speed for water (or the reverse). The media differ by a factor of 4.3. A sonar echo of 0.1 s is 74 m in water but would be 17 m in air — check the menu before trusting the answer.
- Entering the one-way time. Some devices report a computed distance or a one-way time already. This calculator expects the raw round-trip echo time; halving it yourself first quarters the answer.
- Ignoring temperature in air. The 343 m/s figure assumes 20 °C. At 0 °C the true speed is 331 m/s and distances come out about 3.5% smaller — small, but larger than the precision of the timing electronics.
- Expecting echoes from soft, angled or tiny targets. A sloped surface reflects the pulse away from the sensor; foam and fabric absorb it; objects smaller than a wavelength barely reflect at all. A missing echo is information about the target, not a broken formula.
FAQ
Why is sound so much faster in water and steel?
Sound is a vibration passed from particle to particle. Water and steel particles are packed far more tightly and stiffly than air molecules, so the vibration is handed on much faster.
How does a medical ultrasound make a picture?
It sends many pulses in different directions and times every echo. Boundaries between tissues reflect part of the pulse, and the machine builds an image from the echo times and strengths.
What is the smallest time my sensor can use?
That depends on its electronics, but the idea is the same: a parking sensor measuring 0.001 s in air is detecting an object about 17 cm away.
How does sonar differ from radar?
Only in the wave: sonar times sound pulses (v ≈ 1,480 m/s in water), radar times radio pulses (v = 3 × 10⁸ m/s). The formula d = vt/2 is identical — radar's challenge is that its times are nanoseconds where sonar's are milliseconds.
What echo time corresponds to 1 m in air?
t = 2 × 1 / 343 = 5.83 ms. Hobby rangefinders quote this as about 58 µs per centimetre of range — the conversion their code performs thousands of times a second.
Can this measure the distance to the Moon?
Not with sound — there is no air to carry it. With light, yes: lunar laser ranging times pulses to reflectors left by Apollo astronauts at about 2.5 seconds round trip, giving the distance to centimetre precision with d = ct/2.
Why do medical scanners assume 1,540 m/s?
It is the measured average for soft tissue. Fat is slower (about 1,450 m/s) and muscle faster (about 1,580 m/s), so images carry small depth distortions — a known, accepted artefact of using one speed in the formula.
What is the nearest object a parking sensor can see?
Typically 15–25 cm. Closer than that, the echo returns while the transducer is still ringing from its own pulse — the blind zone — so the sensor reports nothing rather than a false zero.
How far can airborne ultrasound reach?
Practically a few metres to a few tens of metres: air absorbs ultrasound strongly, and the beam spreads. Water is far kinder — sonar ranges of kilometres are routine, and the deepest echo in Example 6 took nearly 15 seconds to come home.
Why do bats sweep their call frequency downwards during a pulse?
A frequency sweep gives the returning echo a recognisable signature, letting the bat separate its own echoes from other bats' calls and measure the delay with extra precision by pattern-matching — signal processing layered on top of the same d = vt/2.