# 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.

- Calculator id: `audio-file-size` · Category: Developer & IT (`developer`) · Tool name: `calculate_audio_file_size`
- Canonical page: https://tttkmbb.com/developer/audio-file-size · This document: https://tttkmbb.com/developer/audio-file-size.md · JSON definition: https://tttkmbb.com/developer/audio-file-size.json

## Purpose

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.

**Use when:** 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.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `duration_seconds` | number | s | required | Length of the audio in seconds (3 minutes = 180). (> 0, max 10000000) |
| `format` | enum: pcm_uncompressed \| compressed_bitrate |  | optional, default "pcm_uncompressed" | Whether the size follows from PCM parameters or from a fixed bitrate. |
| `sample_rate_hz` | number | Hz | optional, default 44100 | Samples per second per channel (44100 CD, 48000 video/broadcast, 96000 hi-res); PCM only. (min 1000, max 1000000) |
| `bit_depth` | integer | bits | optional, default 16 | Bits per sample (16 CD, 24 studio, 32 float); PCM only. (min 1, max 64) |
| `channels` | integer |  | optional, default 2 | 1 mono, 2 stereo, 6 for 5.1 surround; PCM only. (min 1, max 64) |
| `bitrate_kbps` | number | kbit/s | optional, default 128 | Constant bitrate in kilobits per second (10³ bit/s), e.g. 128 or 320 for MP3, 96 for Opus; compressed only. (> 0, max 100000) |

## Output

| Field | 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. |

## 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.

## Data Sources

- Pulse-code modulation (Wikipedia) — https://en.wikipedia.org/wiki/Pulse-code_modulation (reference, retrieved 2026-09-24)
- Audio bit depth (Wikipedia) — https://en.wikipedia.org/wiki/Audio_bit_depth (reference, retrieved 2026-09-24)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/audio-file-size?duration_seconds=…`
- `POST https://tttkmbb.com/api/v1/calculate/audio-file-size` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/audio-file-size · OpenAPI operationId `calculate_audio_file_size` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "audio-file-size", "inputs": {…}}`

## Example

- 3 minutes of CD-quality PCM: inputs `{"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: inputs `{"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
```

## Limitations

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. 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. All values are computed from the formula above; no measurement or live data is involved.

## 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

- [Video File Size Calculator](https://tttkmbb.com/everyday/video-file-size.md) — The same calculation for video streams.
- [Download Time Calculator](https://tttkmbb.com/everyday/download-time.md) — Transfer time for the resulting size.
- [Data Storage Converter](https://tttkmbb.com/conversion/data-storage.md) — Convert MB, MiB, GB and other units.
