playgrid.ccBrowse tools

Digital audio timing / Free producer tool

Samples and milliseconds calculator

Convert samples and milliseconds at common audio sample rates, with exact values and explicit nearest, floor and ceiling whole-sample rounding.

Live calculator

Choose the sample rate

Both converters and the buffer table use the same samples-per-second value.

Enter a whole-number rate from 8,000 to 384,000 Hz.

Showing sample timing at 48000 Hz.

Samples to time

Convert samples to milliseconds

Enter a whole number from 0 to 100,000,000 samples.

Duration21.333333 ms
Seconds
0.021333 s
Sample count
1024 samples
One sample
0.020833 ms
Sample rate
48000 Hz

Time to samples

Convert milliseconds to samples

Enter a duration from 0 to 3,600,000 milliseconds.

Exact sample count480 samples
Nearest whole sample
480 samples · 10 ms · 0 ms error
Floor
480 samples · 10 ms · 0 ms error
Ceiling
480 samples · 10 ms · 0 ms error
One sample
0.020833 ms at 48000 Hz

Selected-rate references

Common buffer-size durations

At 48000 Hz

These are block durations only. They do not predict complete recording, monitoring or round-trip latency.

SamplesMillisecondsSeconds
320.666667 ms0.000667 s
641.333333 ms0.001333 s
1282.666667 ms0.002667 s
2565.333333 ms0.005333 s
51210.666667 ms0.010667 s
102421.333333 ms0.021333 s
204842.666667 ms0.042667 s

How sample-time conversion works

A sample rate states how many discrete audio samples occur in one second. At 48 kHz, one second contains 48,000 samples and one sample lasts 1,000 ÷ 48,000, or approximately 0.020833 milliseconds.

The calculator uses these formulas:

  • milliseconds = samples ÷ sample rate × 1,000
  • samples = milliseconds × sample rate ÷ 1,000

Calculations retain full numeric precision. Visible results are rounded only for display and copying.

Why sample rate changes the answer

The same number of samples represents less time at a higher sample rate because more samples occur every second. A 1,024-sample block lasts approximately 23.220 ms at 44.1 kHz, 21.333 ms at 48 kHz and 10.667 ms at 96 kHz.

Use the sample rate of the audio or device whose timing you are interpreting. A sample count has no fixed duration without that rate.

Whole-sample rounding

Milliseconds often convert to a fractional sample count, but a stored sample position or integer delay length may require a whole sample. The calculator exposes three policies instead of silently choosing one:

  • Nearest: uses Math.round for the closest whole sample. For positive half-sample values, this rounds upward.
  • Floor: chooses the largest whole-sample duration that does not exceed the requested time.
  • Ceiling: chooses the smallest whole-sample duration that is not shorter than the requested time.

Each result shows the duration produced by that integer sample count and its signed error relative to the requested milliseconds. At most, floor or ceiling differs by less than one sample period; nearest differs by no more than half a sample period.

Reading buffer-size durations

The reference table converts common powers-of-two sample counts at the selected rate. These block durations can help interpret audio-device buffers, short digital delays, analysis windows and processing blocks.

A block duration is not the same as complete monitoring or round-trip latency. Real paths may include input and output buffers, safety buffers, converter delay, plug-in delay compensation, operating-system scheduling and device-specific processing. The audio latency calculator models stated stages explicitly rather than multiplying one buffer and presenting it as a measured result.

Sound-design uses and limits

  • Translate sample-based delay or lookahead values into time before comparing them with an envelope, transient or modulation rate.
  • Convert a desired short delay into samples when a processor accepts integer sample lengths.
  • Compare the time resolution available at different sample rates: higher rates make each individual sample shorter.
  • Treat a displayed device value as authoritative when its internal rounding policy is documented; different processors may round or interpolate fractional positions differently.
  • Sample-rate conversion changes the time represented by an unchanged sample count. Recalculate after the rate changes.