By Tim King · Updated
Sample Length Calculator
Convert Samples, Milliseconds, Beats and Bars
OneTask is free, with no sign-up, and built by one person.
If this tool saved you time, a coffee helps keep new ones coming.
How the Sample Length Calculator works
This sample length calculator converts a length of audio between samples, milliseconds, seconds, beats and bars. Enter an amount, choose its unit, the sample rate and the tempo, and every other unit is worked out at once, along with how long one sample lasts and how many samples make one beat. It is for setting loop points, buffer sizes, delay lengths and sample-accurate edits.
Digital audio counts time in samples. Editors, samplers and plug-ins often ask for a length in samples while you think in milliseconds or beats, and converting by hand is where off-by-one loop points and drifting delays come from.
How the sample length calculator converts
The formula is simple. Samples = seconds × sample rate, so milliseconds = samples ÷ sample rate × 1,000. One beat at a given tempo lasts 60 ÷ BPM seconds, so samples per beat = sample rate × 60 ÷ BPM, and a bar is that multiplied by the beats per bar.
First example. At 44.1 kHz, 44,100 samples is exactly 1,000 ms, one second. At 120 BPM a beat is 500 ms, so the same 44,100 samples is two beats, or half a bar of 4/4.
Second example. A one-bar loop at 128 BPM and 48 kHz: a beat is 48,000 × 60 ÷ 128 = 22,500 samples, and a 4/4 bar is 90,000 samples. Set a sampler's loop end to 90,000 and it stays locked to the grid indefinitely.
How many samples make a millisecond? 44.1 at 44.1 kHz and 48 at 48 kHz. That is why a buffer of 256 samples adds about 5.3 ms of latency at 48 kHz, and 512 samples about 10.7 ms. Small fractions matter: tempos that do not divide the sample rate evenly give fractional samples per beat, which is why the results keep two decimal places. Round only at the last step.
Samples per beat and per 4/4 bar at common tempos
| BPM | ms per beat | Samples at 44.1 kHz | Samples at 48 kHz | 4/4 bar at 48 kHz |
|---|---|---|---|---|
| 60 | 1000 | 44,100 | 48,000 | 192,000 |
| 70 | 857.14 | 37,800 | 41,143 | 164,571 |
| 80 | 750 | 33,075 | 36,000 | 144,000 |
| 85 | 705.88 | 31,129 | 33,882 | 135,529 |
| 90 | 666.67 | 29,400 | 32,000 | 128,000 |
| 95 | 631.58 | 27,853 | 30,316 | 121,263 |
| 100 | 600 | 26,460 | 28,800 | 115,200 |
| 105 | 571.43 | 25,200 | 27,429 | 109,714 |
| 110 | 545.45 | 24,055 | 26,182 | 104,727 |
| 115 | 521.74 | 23,009 | 25,043 | 100,174 |
| 120 | 500 | 22,050 | 24,000 | 96,000 |
| 125 | 480 | 21,168 | 23,040 | 92,160 |
| 128 | 468.75 | 20,672 | 22,500 | 90,000 |
| 130 | 461.54 | 20,354 | 22,154 | 88,615 |
| 135 | 444.44 | 19,600 | 21,333 | 85,333 |
| 140 | 428.57 | 18,900 | 20,571 | 82,286 |
| 145 | 413.79 | 18,248 | 19,862 | 79,448 |
| 150 | 400 | 17,640 | 19,200 | 76,800 |
| 160 | 375 | 16,538 | 18,000 | 72,000 |
| 170 | 352.94 | 15,565 | 16,941 | 67,765 |
| 174 | 344.83 | 15,207 | 16,552 | 66,207 |
| 180 | 333.33 | 14,700 | 16,000 | 64,000 |
Sample counts in the table are rounded to whole samples; the calculator keeps the fraction. The table under the calculator lists every common note value, dotted and triplet included, at your chosen tempo and rate.
FAQ
How many samples are in one second?
Exactly the sample rate: 44,100 at 44.1 kHz, 48,000 at 48 kHz and 96,000 at 96 kHz. One millisecond is the sample rate divided by 1,000, so 44.1 samples at 44.1 kHz and 48 samples at 48 kHz.
How do I convert samples to milliseconds?
Divide the number of samples by the sample rate and multiply by 1,000. For example, 1,024 samples at 48 kHz is 1,024 ÷ 48,000 × 1,000 = 21.33 ms. Enter the samples, choose the rate and the calculator gives the milliseconds and every other unit.
Why is the number of samples per beat not a whole number?
Because most tempos do not divide the sample rate evenly. At 44.1 kHz and 128 BPM a beat is 20,671.875 samples. Keep the fraction for long loops, or pick a tempo such as 120 or 125 BPM where the beat lands on a whole sample.
See also: all Creative tools, Everyday Maths, Loans & Savings, Dates & Time, Health, Home & DIY, Unit Converters, Education, Science, Garden & Farm, Gaming & PC, Work & Business, Fun, Maps & GPS, DIY & Building, Cost Estimators, Sport & Clubs.
Related tools
BPM To Milliseconds Calculator
Tempo to delay times in ms and Hz for every note value, and back.
Audio Bitrate Calculator
Sample rate, bit depth and channels to kbps and file size per minute.
Note Frequency Calculator
Note to frequency and frequency to note, with cents offset and MIDI number.
A-B Loop Player
Loop a passage between two points and slow it down to practise.
Chord Finder
Name any chord from its notes, with inversions and formulas.