Home › Developer & IT › Audio File Size Calculator
Audio File Size Calculator
Computes the size of an audio recording from its duration and either the PCM parameters (sample rate × bit depth × channels, as in WAV/AIFF/CD audio) or a constant compressed bitrate (MP3, AAC, Opus), in bytes, MB and MiB, plus the minutes that fit in one gigabyte.
When to use
You are planning storage or bandwidth for recordings, podcasts or music libraries, or want to compare uncompressed and compressed formats for a given length.
Do not use when: The file uses variable bitrate with an unknown average, or you need video sizes (use video-file-size); container headers and metadata (a few kB) are ignored.
Formula
PCM: bitrate_bps = sample_rate_hz × bit_depth × channels; compressed: bitrate_bps = bitrate_kbps × 1000; file_size_bytes = bitrate_bps / 8 × duration_seconds; minutes_per_gb = 10⁹ / (bitrate_bps / 8) / 60
Sizes cover the audio stream only; WAV adds a 44-byte header, tagged MP3s a few kB of ID3 metadata. CD audio (44.1 kHz, 16-bit, stereo) is 1,411.2 kbit/s, i.e. about 10.1 MB per minute.
Inputs
| Parameter | Type | Unit | Required | Description |
|---|---|---|---|---|
duration_seconds | number | s | yes | Length of the audio in seconds (3 minutes = 180). Range: > 0, ≤ 10000000 |
format | enum: pcm_uncompressed | compressed_bitrate | default pcm_uncompressed | Whether the size follows from PCM parameters or from a fixed bitrate. | |
sample_rate_hz | number | Hz | default 44100 | Samples per second per channel (44100 CD, 48000 video/broadcast, 96000 hi-res); PCM only. Range: ≥ 1000, ≤ 1000000 |
bit_depth | integer | bits | default 16 | Bits per sample (16 CD, 24 studio, 32 float); PCM only. Range: ≥ 1, ≤ 64 |
channels | integer | default 2 | 1 mono, 2 stereo, 6 for 5.1 surround; PCM only. Range: ≥ 1, ≤ 64 | |
bitrate_kbps | number | kbit/s | default 128 | Constant bitrate in kilobits per second (10³ bit/s), e.g. 128 or 320 for MP3, 96 for Opus; compressed only. Range: > 0, ≤ 100000 |
Outputs
| Output | Type | Unit | Description |
|---|---|---|---|
bitrate_kbps | number | kbit/s | sample_rate × bit_depth × channels / 1000 for PCM, or the given bitrate. |
bytes_per_second | number | bytes/s | bitrate / 8 in bytes per second. |
file_size_bytes | number | bytes | bytes_per_second × duration_seconds (audio data only). |
file_size_mb | number | MB | Size in megabytes (10⁶ bytes). |
file_size_mib | number | MiB | Size in mebibytes (2²⁰ bytes), as shown by most operating systems. |
minutes_per_gb | number | min | How many minutes of audio fit in 10⁹ bytes at this bitrate. |
hours_per_gb | number | h | minutes_per_gb / 60. |
Example
3 minutes of CD-quality PCM: {"duration_seconds":180,"format":"pcm_uncompressed","sample_rate_hz":44100,"bit_depth":16,"channels":2} → {"bitrate_kbps":1411.2,"bytes_per_second":176400,"file_size_bytes":31752000,"file_size_mb":31.752,"file_size_mib":30.281,"minutes_per_gb":94.48}
3 minutes of 128 kbit/s MP3: {"duration_seconds":180,"format":"compressed_bitrate","bitrate_kbps":128} → {"bitrate_kbps":128,"file_size_bytes":2880000,"file_size_mb":2.88,"minutes_per_gb":1041.67}
GET https://tttkmbb.com/api/v1/calculate/audio-file-size?duration_seconds=180&format=pcm_uncompressed&sample_rate_hz=44100&bit_depth=16&channels=2
Machine access
- API:
GET https://tttkmbb.com/api/v1/calculate/audio-file-size(query parameters) orPOSTwith a JSON body{"inputs": {...}} - Schema: https://tttkmbb.com/api/v1/calculators/audio-file-size · Markdown: https://tttkmbb.com/developer/audio-file-size.md · JSON definition: https://tttkmbb.com/developer/audio-file-size.json
- MCP: server
https://tttkmbb.com/mcp, toolrun_calculator with calculator_id="audio-file-size" - OpenAPI operationId:
calculate_audio_file_size - Freshness:
static. Authentication: none. Rate limit: fair use (see rate limits).
Sources
- Pulse-code modulation (Wikipedia) (reference)
- Audio bit depth (Wikipedia) (reference)
FAQ
Is a kilobit 1000 or 1024 bits here?
1000, as in the bitrate figures shown by encoders and players (128 kbit/s = 128,000 bit/s). MB is 10⁶ bytes and MiB 2²⁰ bytes; both are reported.
How big is FLAC?
FLAC is lossless but variable: typically 50–70 % of the PCM size for music. Compute the PCM size and multiply by the expected ratio.
Why is my MP3 slightly larger than calculated?
ID3 tags (often with embedded cover art of 20–500 kB) and frame headers are added to the audio stream; VBR files also deviate from the nominal bitrate.
Related calculators
- Video File Size Calculator — The same calculation for video streams.
- Download Time Calculator — Transfer time for the resulting size.
- Data Storage Converter — Convert MB, MiB, GB and other units.