HomeDeveloper & 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

ParameterTypeUnitRequiredDescription
duration_secondsnumbersyesLength of the audio in seconds (3 minutes = 180). Range: > 0, ≤ 10000000
formatenum: pcm_uncompressed | compressed_bitratedefault pcm_uncompressedWhether the size follows from PCM parameters or from a fixed bitrate.
sample_rate_hznumberHzdefault 44100Samples per second per channel (44100 CD, 48000 video/broadcast, 96000 hi-res); PCM only. Range: ≥ 1000, ≤ 1000000
bit_depthintegerbitsdefault 16Bits per sample (16 CD, 24 studio, 32 float); PCM only. Range: ≥ 1, ≤ 64
channelsintegerdefault 21 mono, 2 stereo, 6 for 5.1 surround; PCM only. Range: ≥ 1, ≤ 64
bitrate_kbpsnumberkbit/sdefault 128Constant bitrate in kilobits per second (10³ bit/s), e.g. 128 or 320 for MP3, 96 for Opus; compressed only. Range: > 0, ≤ 100000

Outputs

OutputTypeUnitDescription
bitrate_kbpsnumberkbit/ssample_rate × bit_depth × channels / 1000 for PCM, or the given bitrate.
bytes_per_secondnumberbytes/sbitrate / 8 in bytes per second.
file_size_bytesnumberbytesbytes_per_second × duration_seconds (audio data only).
file_size_mbnumberMBSize in megabytes (10⁶ bytes).
file_size_mibnumberMiBSize in mebibytes (2²⁰ bytes), as shown by most operating systems.
minutes_per_gbnumberminHow many minutes of audio fit in 10⁹ bytes at this bitrate.
hours_per_gbnumberhminutes_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

Sources

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