# WAV Audio Trimmer

> Cuts one time range from a PCM or IEEE-float WAV and writes it as a new WAV without decoding, resampling or re-encoding the audio. Every retained sample byte stays unchanged, and the file never leaves this browser tab.

Use it: https://tessalor.com/en/audio/wav-audio-trimmer

This tool runs entirely in the browser. Nothing entered into it is uploaded.

## How it is done

1. Check that the first twelve bytes identify a little-endian RIFF or RF64 WAVE file. A big-endian RIFX file is refused because copying its samples into a little-endian container would change their meaning.
2. Walk the RIFF chunk list, respecting the pad byte after an odd-length payload, until the fmt and data chunks have both been found. For RF64, read the 64-bit audio length from its ds64 chunk.
3. Read the channel count, sample rate, block alignment and bit depth from fmt. If the format is WAVE_FORMAT_EXTENSIBLE, unwrap its sub-format GUID to distinguish PCM from IEEE float.
4. Verify that the format is fixed-width PCM or IEEE float and that the declared block alignment equals channels multiplied by bytes per sample. A compressed or internally inconsistent file is refused rather than cut at a guessed boundary.
5. Divide the data length by the block alignment to get the exact number of complete sample frames and, from that, the recording length.
6. Multiply each requested time by the sample rate and round to the nearest whole frame. Clamp an end beyond the recording to its final frame; refuse a start at or beyond the end.
7. Copy the selected frame range in 4 MB pieces into a fresh WAV. The format block is preserved, a new fact count is written for float audio, and the RIFF and data sizes are recalculated.
8. Leave metadata chunks out of the result because their cue positions, loop points and time references would describe the untrimmed recording. Offer the new metadata-free WAV as a download.

## Assumptions

- PCM and IEEE-float WAV files are supported, including WAVE_FORMAT_EXTENSIBLE and RF64. Compressed WAV encodings and big-endian RIFX are not, because cutting either safely requires decoding or byte-order conversion.
- A requested time can fall between sample frames. It is rounded to the nearest complete frame, so the largest timing adjustment is half a frame — about 0.011 milliseconds at 44.1 kHz.
- An end time beyond the file is clamped to the last complete frame. A start at or beyond that frame leaves no playable audio and is refused rather than producing an empty file.
- The sample rate, channel count, bit depth, format block and retained sample bytes are copied. There is no gain change, fade, resampling, dither or codec pass.
- Metadata is deliberately not copied. Broadcast time references, cue points, regions, loops, labels, artwork and comments would otherwise point into the old timeline or disclose details the visitor did not intend to keep.
- A data chunk must contain a whole number of sample frames and fit inside the file. A partial last frame or a chunk length past the end is treated as truncation rather than silently repaired.
- The whole input and the trimmed output exist in memory at once. Input is therefore capped at 256 MB, and a bounded RF64 result is written as an ordinary RIFF WAV.

## Inputs

| Name | Label | Type | Default | Range |
| --- | --- | --- | --- | --- |
| `source` | WAV file | file | chosen on your device | audio/wav, audio/x-wav, audio/wave, audio/vnd.wave, up to 256 MB |
| `startTime` | Start time (seconds) | number | 0 | 0 to 86400 |
| `endTime` | End time (seconds) | number | 30 | 0.001 to 86400 |

## Outputs

- `trimmedSeconds` — Trimmed length (seconds) (number), primary
- `originalSeconds` — Original length (seconds) (number)
- `startFrame` — First sample frame (integer)
- `frames` — Sample frames kept (integer)
- `fileBytes` — Output size (bytes) (integer)

## Questions

### Does trimming a WAV reduce its audio quality?

No, not for the supported PCM and IEEE-float files. Complete sample frames are copied byte for byte, so there is no codec generation, resampling, gain change or dither. The complete file has different bytes because its container sizes are new and its metadata is omitted, but the retained audio payload is unchanged.

### Why is the cut a fraction of a millisecond from the time I entered?

Digital audio can start only on a sample frame, not between two of them. Each time is rounded to the nearest frame, which limits the difference to half a frame: about 0.011 milliseconds at 44.1 kHz or 0.010 milliseconds at 48 kHz.

### Which kinds of WAV file can this trim?

Little-endian RIFF and RF64 files containing integer PCM or 32-bit or 64-bit IEEE-float audio are supported, including the extensible format used for high bit depths and multichannel recordings. Compressed WAV and big-endian RIFX need a decoder or byte-order conversion and are refused.

### Why are my WAV markers and comments missing afterward?

They were left out deliberately. A cue point, loop boundary or broadcast time reference is measured against the original recording; copying it unchanged would put it at the wrong point in the trimmed file. The output contains only the audio format, a frame count when needed, and the audio.

### Does the WAV leave my browser while it is trimmed?

No. A worker in this tab reads the header and copies the selected bytes, then the browser offers those bytes as a local download. The page's automated browser test loads a real WAV and fails if any request leaves the site while the file is present.

### Why will it not trim my MP3 even when I renamed it to .wav?

A filename does not change an audio format. MP3 stores compressed frames with boundaries and timing rules that are not WAV sample frames, so the first bytes are checked rather than trusting the extension. Converting or cutting MP3 requires a codec and is a different operation.

## Sources

- [RFC 2361: WAVE and AVI Codec Registries](https://www.rfc-editor.org/info/rfc2361/) — IETF, applies to 1998. Retrieved 2026-08-01.
- [Wave File Specifications](https://www.mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html) — MMSP Lab, Department of Electrical and Computer Engineering, McGill University, applies to 2022. Retrieved 2026-08-01.
- [WAVEFORMATEXTENSIBLE structure (mmreg.h)](https://learn.microsoft.com/en-us/windows/win32/api/mmreg/ns-mmreg-waveformatextensible) — Microsoft, applies to 2023. Retrieved 2026-08-01.
- [EBU Tech 3306: RF64, An Extended File Format for Audio](https://tech.ebu.ch/publications/tech3306) — European Broadcasting Union. Retrieved 2026-08-01.

## Variants

- [Can I cut a WAV file without losing audio quality?](https://tessalor.com/en/audio/wav-audio-trimmer/cut-wav-without-losing-quality)
- [How do I remove the first 30 seconds from a WAV file?](https://tessalor.com/en/audio/wav-audio-trimmer/remove-first-30-seconds-from-wav)

---

Estimate, not advice. See https://tessalor.com/en/disclaimer.
Machine-readable catalogue: https://tessalor.com/api/tools.json
