Sample rate converter
Find the exact relationship between two audio sample rates: the conversion ratio and the rational L/M resampling factors (upsample by L, downsample by M). You can also convert a sample count from the source rate to the target rate. It is aimed at audio engineers and developers setting up resampling pipelines.
Why the L/M factors matter
When you resample audio in software, the algorithm conceptually operates in two steps: first upsample by L (insert L−1 zero samples between each original sample), apply a low-pass filter at half the original Nyquist frequency, then downsample by M (keep every Mth sample). The integer ratio L/M tells you the minimum computational cost of the resampling operation. A ratio of 160/147 for 44.1 → 48 kHz means the filter must operate at 160× the output rate before decimation — significantly more expensive than, say, the trivial 1/2 downsample from 96 kHz to 48 kHz.
This is why the “awkward” 44.1 kHz to 48 kHz conversion is notorious: the 160/147 ratio has large factors, and a polyphase filter bank must compute 160 distinct phases. High-quality SRC libraries (libsamplerate, Secret Rabbit Code, SoX) handle this automatically, but understanding the factors helps you predict processing cost and choose the right quality/speed tradeoff.
How it works
The ratio is simply target ÷ source. To get the integer resampling factors, the
tool divides both rates by their greatest common divisor (GCD):
L = target ÷ gcd(source, target) M = source ÷ gcd(source, target)
Resampling then means inserting samples to upsample by L, then discarding to
downsample by M. A converted sample count is original × ratio.
Example
Converting 44,100 Hz to 48,000 Hz:
| Quantity | Value |
|---|---|
| Ratio (48000 ÷ 44100) | ≈ 1.0884 |
| GCD | 300 |
| L / M | 160 / 147 |
| 44,100 samples → | ~48,000 samples |
By contrast, converting 48,000 Hz to 96,000 Hz is trivially cheap: the ratio is exactly 2, GCD is 48,000, L/M is 2/1 — just insert one zero between every sample and filter. Knowing whether your conversion is a simple integer ratio or an awkward fraction helps you plan your audio pipeline.
Common conversion pairs
| Source | Target | Ratio | L / M |
|---|---|---|---|
| 44,100 Hz | 48,000 Hz | ≈ 1.0884 | 160 / 147 |
| 48,000 Hz | 44,100 Hz | ≈ 0.9188 | 147 / 160 |
| 44,100 Hz | 88,200 Hz | 2.000 | 2 / 1 |
| 48,000 Hz | 96,000 Hz | 2.000 | 2 / 1 |
| 22,050 Hz | 44,100 Hz | 2.000 | 2 / 1 |
| 16,000 Hz | 48,000 Hz | 3.000 | 3 / 1 |
Everything is computed locally in your browser; no audio is processed or uploaded.