File Formats
  • Audio
  • Video
  • Images
  • 3D & CAD
  • Documents
  • Data
  • Code
  • System
Audio
  • Uncompressed
  • Lossless
  • Lossy
  • MIDI & trackers
  • Music projects
  • Instruments & samples
  • Playlists
  1. Home
  2. Audio
  3. Uncompressed
  4. WAV
  5. RIFF chunks
.WAV
  • Overview
  • RIFF chunks
  • Format chunk
  • Sample data
  • Metadata chunks
    • fact
    • LIST INFO
    • cue
    • smpl
    • bext
  • RF64

RIFF chunks

A WAV file is a RIFF file: one outer chunk that holds a list of inner chunks. Every chunk has the same eight-byte header, so a reader can step over chunks it does not know.

The RIFF header

The file starts with the outer chunk’s header and its form type.

OffsetSizeTypeNameDescription
04char[4]ckIDRIFF, or RF64 for a file over 4 GB
44u32ckSizethe size of everything after this field: the file size minus 8
84char[4]formTypeWAVE

The chunk layout

The rest of the file is a run of chunks, back to back. All numbers are little-endian.

OffsetSizeTypeNameDescription
+04char[4]ckIDfour ASCII characters naming the chunk, padded with spaces, such as fmt and data
+44u32ckSizethe size of the chunk’s data, not counting this header or the pad byte
+8ckSizebytesckDatathe chunk’s contents
+8+ckSize0 or 1u8pada zero byte, present only when ckSize is odd

The pad byte keeps every chunk on an even offset. It is easy to forget: an 8-bit mono file with an odd number of samples has an odd data size, and the next chunk starts one byte later than the size alone suggests.

Chunk order

The format chunk must come before the data chunk, because the data cannot be read without it. Other chunks can appear before or after, in any order. Writers often put small metadata chunks first and the data chunk last, or append metadata after the samples once a recording has finished.

A reader should look for chunks by ID and skip any it does not recognise, using the size and the pad rule. A JUNK chunk holds nothing useful and is there only to reserve space or align the data.

ChunkHoldsRequired
fmt how the audio is encodedyes
datathe samplesyes
factthe number of sample framesfor compressed formats
LISTtext tags, or labels for cue pointsno
cue markers at sample positionsno
smplroot note and loop points for samplersno
bextbroadcast production detailsno
JUNKreserved space, ignoredno

A complete file

The smallest useful WAV file is 44 bytes of headers and then the samples. This one holds four frames of 16-bit stereo audio at 44,100 Hz.

00000000  52 49 46 46 34 00 00 00 57 41 56 45 66 6D 74 20  RIFF4...WAVEfmt 
00000010  10 00 00 00 01 00 02 00 44 AC 00 00 10 B1 02 00  ........D.......
00000020  04 00 10 00 64 61 74 61 10 00 00 00 00 00 00 00  ....data........
00000030  FF 7F 01 80 FF FF 01 00 00 01 00 FF              ............
A 60-byte WAV file, with the chunk IDs marked.
OffsetBytesMeaning
052 49 46 46RIFF
434 00 00 0052 bytes follow: the file is 60 bytes
857 41 56 45WAVE
1266 6D 74 20fmt chunk
1610 00 00 0016 bytes of format data
2001 00format code 1, PCM
2202 002 channels
2444 AC 00 0044,100 samples per second
2810 B1 02 00176,400 bytes per second
3204 004 bytes per frame
3410 0016 bits per sample
3664 61 74 61data chunk
4010 00 00 0016 bytes of samples: 4 frames
4416 bytesthe samples, decoded on Sample data

Finding the samples

A robust reader never assumes the 44-byte layout. It walks the chunks:

  1. Read 12 bytes and check for RIFF and WAVE.
  2. Read an 8-byte chunk header.
  3. If the ID is fmt , read the format. If it is data, note where the samples start and how long they are.
  4. Skip ckSize bytes, plus one more if ckSize is odd, and go back to step 2 until the end of the file.
© 2026 fileformats.org About Contact Made by Lewpen