How to trim an audio file
- Drop an MP3, M4A, WAV, FLAC or Opus file on the box above.
- Drag across the waveform to select the part to keep, or type the start and end times. Play it to check; Use playhead sets a time from where you paused.
- Press Trim audio, listen to the result and download it. The box under the player shows where the cut landed and how many frames were copied unchanged.
Why a lossless cut can't fall on any millisecond
Compressed audio is stored in small blocks called frames, and each frame is decoded as a whole. Cutting without re-encoding means keeping whole frames, so the cut can only land on a frame boundary. How far apart those are depends on the format:
| Format | Frame length | What the cut does here |
|---|---|---|
| MP3 | 1,152 samples — 26.1 ms at 44.1 kHz | Starts at the frame boundary, plus 2 frames of lead-in |
| M4A (AAC) | 1,024 samples — 23.2 ms at 44.1 kHz | Exact: the file tells players where to start |
| Opus, Ogg | usually 20 ms | Starts at the packet boundary, plus 80 ms of lead-in |
| FLAC | usually 4,096 samples — 93 ms | Starts at the frame boundary; FLAC frames stand alone |
| WAV | no frames | Exact to the sample |
A few milliseconds either way is rarely audible as a timing difference. It does mean that a trimmer which cuts an MP3 on any millisecond you like has re-encoded it. This tool keeps the original frames and tells you, to the millisecond, where the start and end actually are.
The MP3 catch: the first frame after a cut
MP3 encoders save space by letting a frame keep part of its data in the frame before it (the "bit reservoir"). Cut exactly on a frame boundary and the first frame of the new file is missing that borrowed data. We measured it on a test MP3: with a plain frame-boundary cut, the first 35 milliseconds after the cut point decoded wrongly. Keeping two frames before the cut (52 ms) fixed it completely: from the first sample of the chosen start, the trimmed file decoded identically to the original.
So an MP3 trimmed here begins 52 to 78 milliseconds before your start time. That lead-in is part of the recording you chose to cut from, not added noise, and the result box says how long it is.
What we measured
Each format was cut from 5.300 to 12.700 seconds of the same 20-second test recording. The trimmed file was decoded by the browser and lined up against the original, sample by sample:
| File | Trimmed file starts at | Frames copied unchanged | Sound from 5.300 s on |
|---|---|---|---|
| MP3, 128 kbps | 5.224 s | 287 of 287 | Identical |
| M4A, AAC | 5.300 s | 320 of 320 | Identical |
| FLAC | 5.294 s | 80 of 80 | Identical |
| WAV | 5.300 s | — | Identical |
| Opus (libopus) | 5.220 s | 375 of 375 | Identical after 0.3 s |
Opus frames are copied unchanged too, but its decoder carries a little state from one packet to the next and needs a moment to settle. In the first 0.3 seconds after the cut the sound differed slightly from the original, by at most 6% of full scale, which is why Opus gets 80 ms of lead-in.
When to choose the WAV option
Choose Cut to the exact sample when the start has to be exact: a loop that must repeat without a gap, a sound effect lined up with a video frame, or a sample for music software. The part you keep is decoded and saved as 16-bit WAV, starting and ending exactly where you said; in our tests it started at 5.300 s from MP3, M4A and Opus alike. WAV is uncompressed, about 10 times the size of a 128 kbps MP3. To cut a video rather than its sound, use Trim Video; to take the sound out of a video first, use Extract Audio from Video.
The audio never leaves your device: it is read, cut and saved in your browser.