Convert between duration and exact sample count at any sample rate — for precise audio programming and editing work.
The Sample Count Calculator converts between time and the number of samples in digital audio. Know exactly how many samples are in 250 ms at 48 kHz (12,000), or how long 1,048,576 samples last at 44.1 kHz (23.78 s).
It is useful for programming audio code, setting loop points in samples, sizing buffers and understanding how sample rate relates to bandwidth.
samples = seconds × sample rate; seconds = samples ÷ sample rate. The sample period is 1/sample rate (22.68 µs at 44.1 kHz). The Nyquist frequency — the highest representable frequency — is half the sample rate. A 16-bit file uses 2 bytes per sample per channel.
Convert times to sample offsets.
Set exact loop lengths.
Relate buffers to time.
Understand sampling.
| Rates | 8–192 kHz |
|---|---|
| Outputs | Samples, duration, period, Nyquist, size |
48,000 per channel.
Half the sample rate — the highest frequency that can be represented.
Audio programmers, plugin developers, and anyone doing sample-accurate editing where a rounding error of even one sample matters.
This tool runs entirely in your browser using the Web Audio API. Nothing is uploaded, stored or shared — there is no server to send your file to, so it works offline once the page has loaded.
Be the first to share your experience with this tool — your feedback helps others.