Audio Trimmer

Cut an audio clip to the exact millisecond with draggable waveform handles, preview the selection, add fade-in and fade-out, and export a 16-bit WAV.

Audio decoding, trimming and WAV export all happen locally in your browser. Your file is never uploaded.

Choose an audio file

MP3, WAV, M4A or OGG — decoded with your browser's own audio codecs

How It Works

The pipeline is decode → select → resample to 16-bit integers. Your file is read into memory and handed to AudioContext.decodeAudioData, which turns any codec the browser understands into a raw PCM AudioBuffer. The two handles define a selection in seconds, snapped to 10-millisecond steps, and export copies exactly that slice of PCM, applies the fade ramps, converts each float sample to a signed 16-bit integer and writes it into a hand-built WAV header.

Why the waveform shows peaks, not samples
One canvas column stands for thousands of samples, so the renderer stores the minimum and maximum of every column instead of individual values. A min/max pair keeps quiet passages visible and loud transients honest — downsampling to plain averages would make percussive edits look flat in exactly the places you need to see.
Why the output is WAV
WAV is a lossless container: after decoding, writing the same PCM into a 16-bit WAV adds no codec generation loss. MP3 would require shipping an encoder into the page and re-introducing lossy compression on top of the decoder's approximations, so it is deliberately not included — trim here, encode elsewhere if you truly need MP3.
Fades are gain ramps, not filters
The fade-in slider multiplies the first milliseconds of the selection by a ramp from 0 to 1, and fade-out does the mirror at the end. That removes the click you get from cutting a waveform mid-slope; the spectral content in between stays untouched.

Frequently Asked Questions

Can I keep the original MP3 quality?

No, and the page is honest about why: to edit audio the browser must first decode your file into raw PCM samples, and going back to MP3 requires an encoder that this page does not ship. Writing a lossless WAV avoids the decode-then-re-encode generation loss a lossy chain would add, so the export here is always a 16-bit WAV.

How large a file can I trim?

Decoded PCM costs roughly 44 bytes per sample per channel of working memory (32-bit floats in two channels), so a 5-minute stereo track sits around 50 MB in RAM plus the waveform peaks. Very long recordings may fail to decode or export on low-memory devices — for those, split the file first.

Can I cut a ringtone for my iPhone?

Yes as a workflow: trim and export the WAV here, then save the file to the Files app and assign it as a ringtone through a desktop-free shortcut or a ringtone maker app that expects a short clip. This page only produces the trimmed audio file; the ringtone step happens on your device.

Why can the browser not open my OGG or M4A?

decodeAudioData uses the codecs installed in your browser, and support differs: MP3 and WAV decode everywhere mainstream, AAC inside M4A decodes in Safari, Chrome and Edge, and OGG Vorbis in all but Safari. If your build lacks the codec the decode promise rejects and the page shows that error line instead of guessing.

Is anything uploaded to a server?

No. The file is read into memory, decoded by your browser, and the trimmed WAV is assembled and downloaded locally. There is no upload request, no account and no storage — disconnect the network after the page loads and the tool keeps working.