Free browser tool · Local processing

Sample Length Calculator

Calculate sample-accurate musical clip lengths. No account, upload or installation required.

ResultEnter values to calculate

Calculate sample-accurate musical clip lengths. It is designed for sample-library makers and audio programmers needing musical and sample-accurate lengths.

The calculation in one line

sample count = duration in seconds × sample rate

Keep the distinction between a sample as an audio clip and a sample as one amplitude measurement. This tool reports the latter count.

Worked example

An 8-second loop at 48 kHz contains 384,000 discrete samples per channel.

Are samples and sample frames the same?

For mono audio, one frame contains one sample value. For stereo, each frame contains two simultaneous sample values—one per channel. This calculator reports samples per channel, which equals the frame count for standard interleaved PCM.

Three checks before using the answer

  • Use the actual session sample rate.
  • Keep channel count separate from duration.
  • Distinguish bit depth from sample count.

A detail that changes the interpretation

A codec may add encoder delay or padding, so decoded file length can differ from the theoretical PCM count for a musical region.

Most common mistake

Multiplying by bit depth or channel count when the desired result is samples per channel rather than total storage size.

Where the calculation stops

Sample-rate conversion, time stretching and encoded formats can change stored frame counts or introduce padding.

Research note

Browser AudioBuffer data is organized by channel and sample rate; musical loop preparation still requires exact boundaries. Read MDN’s Web Audio API overview and Ableton Live’s audio, tempo and warping manual. External documentation supports the technical context; its publishers do not endorse PulseKit.

Questions musicians ask

Who is this sample length calculator for?

It is intended for sample-library makers and audio programmers needing musical and sample-accurate lengths.

What should I listen for after calculating?

Keep the distinction between a sample as an audio clip and a sample as one amplitude measurement. This tool reports the latter count.

Can the result be technically correct but musically wrong?

Yes. Sample-rate conversion, time stretching and encoded formats can change stored frame counts or introduce padding.

Inputs stay on this device. Display rounding never changes the underlying formula.