Sample Count Calculator

Convert between duration and exact sample count at any sample rate — for precise audio programming and editing work.

How to use the Sample Count Calculator

  1. Enter your valuesChoose a direction, then enter a duration (or a sample count) and the sample rate and channels.
  2. Read the results instantlyThe converted value plus sample period, Nyquist frequency and uncompressed size appear.
  3. Copy or sharePress the copy icon on any result card, or use Copy link to these values — the page URL stores your inputs so you can bookmark or send the exact calculation.

About the Sample Count Calculator

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.

How the Sample Count Calculator works

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.

samples = seconds × sample rate

What people use it for

Audio programming

Convert times to sample offsets.

Loop points

Set exact loop lengths.

Buffer sizing

Relate buffers to time.

Learning DSP

Understand sampling.

Tips for the best results

  • 44,100 samples = exactly 1 second at 44.1 kHz.
  • To find milliseconds: samples ÷ sample rate × 1000.
  • Keep sample counts integer for seamless loops.

Common problems & fixes

Fractional sample countsRound to the nearest sample; the error is under half a sample.
Mono vs stereo totalsTotal samples = per-channel × channels.

Quick facts

Rates8–192 kHz
OutputsSamples, duration, period, Nyquist, size

Frequently asked questions

How many samples in a second at 48 kHz?

48,000 per channel.

What is the Nyquist frequency?

Half the sample rate — the highest frequency that can be represented.

Who needs exact sample counts?

Audio programmers, plugin developers, and anyone doing sample-accurate editing where a rounding error of even one sample matters.

Your audio never leaves your device

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.

← Browse all free audio tools

User Reviews

–
No ratings yet
Write a review
Your rating *

Your email is never published. Reviews are moderated, and links aren't allowed.

What users are saying

No reviews yet

Be the first to share your experience with this tool — your feedback helps others.