Closed pipe harmonic frequency calculator
A pipe closed at one end and open at the other resonates at a distinctive sequence of frequencies: the fundamental, the third harmonic, the fifth harmonic, and higher odd harmonics.
Run — free
This calculator finds one of those frequencies from the odd harmonic number, the speed of sound, and the pipe length. It applies the ideal closed-pipe relationship directly, rejects even harmonic numbers that cannot occur in this model, and returns a clear deterministic result for classroom acoustics, laboratory checks, musical instrument estimates, and automated engineering worksheets.
Understand the closed-open pipe model
A closed-open pipe has a displacement node at its closed end and a displacement antinode at its open end. Those boundary conditions permit a quarter of a wavelength in the fundamental mode, so the fundamental wavelength is four times the pipe length. Higher resonances must preserve the same end conditions, which is why only odd multiples of the fundamental fit: 1, 3, 5, 7, and so on. Enter that physical harmonic number in harmonic_number, not the ordinal position of the resonance. For example, the second allowed resonance is harmonic number 3, not harmonic number 2. The calculator deliberately rejects zero, negative, fractional, and even values because accepting them would describe a mode that the ideal closed-open model does not support. This distinction matters when comparing a stopped organ pipe or simplified clarinet air column with an open-open pipe, where every positive integer harmonic is permitted. The result assumes a uniform pipe with one perfectly closed end and one perfectly open end, without end correction or losses.
Enter consistent measurements and read the result
Provide harmonic_number as a positive odd integer, speed_of_sound as a positive finite value, and pipe_length as a positive finite value. With metres per second for speed and metres for length, frequency_hz is in hertz. Other consistent length units also work mathematically: if speed and length use the same length unit, that unit cancels and the result remains cycles per second. The calculator evaluates f_n = n v divided by 4 L, where n is the selected odd harmonic, v is sound speed, and L is pipe length. At a fixed pipe length, increasing the harmonic number raises frequency in direct proportion. At a fixed harmonic and sound speed, doubling the pipe length halves frequency. Sound speed depends on the medium and conditions, so use a measured or appropriately chosen value when accuracy matters. The returned object repeats the normalized inputs, labels the pipe as closed_open, states the formula, and reports a stably rounded frequency so identical inputs produce identical JSON in browser and API workflows.
Apply the calculation responsibly
Use this capability when the harmonic number is already known and the question asks for the corresponding resonance frequency. It is useful for checking physics exercises, preparing resonance-tube experiments, estimating the ideal modes of stopped pipes, or generating answer keys in a learning system. The browser calculation is suited to individual checks, while API automation costs $0.002 for each successful item and can support repeatable batches of independent problems. Treat the output as an ideal acoustic prediction rather than a complete instrument model. Real pipes can behave as though they are slightly longer because the pressure disturbance extends beyond the open end; temperature, gas composition, bore shape, tone holes, wall losses, and coupling to a reed can also shift measured resonances. This calculator does not infer sound speed from temperature, apply an end correction, or simulate those effects. If an experiment differs from the result, first confirm that the entered harmonic is odd and that units are consistent, then consider whether the real apparatus departs from the uniform closed-open assumptions.
What you can do with it
Check an acoustics exercise
Verify the frequency of a specified odd harmonic without accidentally applying the open-open pipe formula.
Plan a resonance-tube experiment
Estimate where an ideal closed-open air column should resonate before comparing the prediction with measured peaks.
Generate deterministic answer keys
Create stable frequency results for worksheets and tutoring software from explicit harmonic, speed, and length inputs.
FAQ
Why are even harmonic numbers rejected?
The closed and open boundary conditions allow only odd multiples of the fundamental in the ideal uniform-pipe model.
What formula does the calculator use?
It uses f_n = n v / (4 L), with positive odd n, sound speed v, and pipe length L.
Which units should I use?
Use consistent length units. Metres per second and metres produce frequency in hertz; matching alternative length units also cancel correctly.
Does it include open-end correction?
No. It uses the ideal geometric pipe length and does not estimate the extra effective length at the open end.
Is harmonic number 3 the second resonance?
Yes. The allowed sequence is harmonic 1, then 3, then 5, so harmonic 3 is the second permitted resonance.
What does API automation cost?
Each successful item uses the published base price of $0.002; invalid inputs are rejected instead of producing a frequency.
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/optics/closed-pipe-harmonic \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"harmonic_number":3,"speed_of_sound":343,"pipe_length":0.5}'const res = await fetch("https://api.kit.forhosting.com/optics/closed-pipe-harmonic", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"harmonic_number": 3,
"speed_of_sound": 343,
"pipe_length": 0.5
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/optics/closed-pipe-harmonic",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"harmonic_number": 3,
"speed_of_sound": 343,
"pipe_length": 0.5
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/optics/closed-pipe-harmonic", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"harmonic_number":3,"speed_of_sound":343,"pipe_length":0.5}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"harmonic_number":3,"speed_of_sound":343,"pipe_length":0.5}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/optics/closed-pipe-harmonic", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"harmonic_number": 3,
"speed_of_sound": 343,
"pipe_length": 0.5
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "optics.closed_pipe_harmonic",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |