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. Format chunk
.WAV
  • Overview
  • RIFF chunks
  • Format chunk
  • Sample data
  • Metadata chunks
    • fact
    • LIST INFO
    • cue
    • smpl
    • bext
  • RF64

Format chunk

The fmt chunk says how the samples in the data chunk are encoded. It comes in three sizes, each extending the one before, and its first field decides how the rest of the file is read.

Fields

Offsets are from the start of the chunk’s data, after the eight-byte chunk header. In the usual 44-byte layout the data starts at file offset 20.

OffsetSizeTypeNameDescription
02u16wFormatTagthe format code: 1 for PCM, 3 for float, 0xFFFE for extensible
22u16nChannelsthe number of channels
44u32nSamplesPerSecsample frames per second, such as 44,100 or 48,000
84u32nAvgBytesPerSecbytes per second: nSamplesPerSec × nBlockAlign for PCM
122u16nBlockAlignbytes per frame: nChannels × bytes per sample for PCM, or the codec’s block size
142u16wBitsPerSamplebits per sample: 8, 16, 24, 32 or 64 for PCM and float
162u16cbSizethe number of extra bytes after this field: 0, 22 for extensible, or a codec’s own data
182u16wValidBitsPerSampleextensible only: how many bits of each sample are used, such as 20 in a 24-bit container
204u32dwChannelMaskextensible only: which speaker each channel feeds, see channel mask
2416GUIDSubFormatextensible only: the real format code, inside a GUID, see SubFormat

Three sizes

The chunk size tells which version a file uses.

SizeStructureUsed for
16PCMWAVEFORMATplain PCM: the six fields up to wBitsPerSample
18 or moreWAVEFORMATEXadds cbSize; non-PCM formats should use it, and codecs put their own data after it
40WAVEFORMATEXTENSIBLEwFormatTag is 0xFFFE and cbSize is 22; needed for more than two channels, more than 16 bits, or a channel mask

Readers should accept all three, and should read cbSize only when the chunk is long enough to hold it.

Format codes

Microsoft registered hundreds of codes. These are the ones commonly met in WAV files.

CodeNameAudio
0x0001 (1)WAVE_FORMAT_PCMinteger PCM
0x0002 (2)WAVE_FORMAT_ADPCMMicrosoft ADPCM
0x0003 (3)WAVE_FORMAT_IEEE_FLOAT32 or 64-bit floating point
0x0006 (6)WAVE_FORMAT_ALAWG.711 A-law, 8-bit codes
0x0007 (7)WAVE_FORMAT_MULAWG.711 µ-law, 8-bit codes
0x0011 (17)WAVE_FORMAT_DVI_ADPCMIMA ADPCM, 4 bits per sample
0x0031 (49)WAVE_FORMAT_GSM610GSM 6.10 speech
0x0050 (80)WAVE_FORMAT_MPEGMPEG audio layer 1 or 2
0x0055 (85)WAVE_FORMAT_MPEGLAYER3MP3
0xFFFE (65534)WAVE_FORMAT_EXTENSIBLEsee SubFormat

Channel mask

In an extensible format chunk, each set bit of dwChannelMask names a speaker. The channels in each frame appear in the order of the set bits, lowest first. A mask of 0 means the channels have no particular speaker.

BitSpeakerBitSpeaker
0x1front left0x200side left
0x2front right0x400side right
0x4front centre0x800top centre
0x8low frequency (LFE)0x1000top front left
0x10back left0x2000top front centre
0x20back right0x4000top front right
0x40front left of centre0x8000top back left
0x80front right of centre0x10000top back centre
0x100back centre0x20000top back right

Common masks are 0x4 for mono, 0x3 for stereo, 0x3F for 5.1 (front left, front right, centre, LFE, back left, back right) and 0x63F for 7.1 with side speakers.

SubFormat

An extensible chunk carries its real format as a GUID. For the classic formats, the first two bytes are the old format code and the rest is fixed: 0000xxxx-0000-0010-8000-00AA00389B71. A GUID is stored with its first three groups little-endian, so on disk PCM is 01 00 00 00 00 00 10 00 80 00 00 AA 00 38 9B 71 and float starts 03 00 instead.

An example

The format chunk of a 24-bit, 48 kHz, 5.1 surround file.

00000000  66 6D 74 20 28 00 00 00 FE FF 06 00 80 BB 00 00  fmt (...........
00000010  00 2F 0D 00 12 00 18 00 16 00 18 00 3F 00 00 00  ./..........?...
00000020  01 00 00 00 00 00 10 00 80 00 00 AA 00 38 9B 71  .............8.q
An extensible format chunk, with offsets from the start of the chunk.
FieldBytesValue
ckSize28 00 00 0040
wFormatTagFE FF0xFFFE, extensible
nChannels06 006
nSamplesPerSec80 BB 00 0048,000
nAvgBytesPerSec00 2F 0D 00864,000
nBlockAlign12 0018 bytes per frame: 6 channels × 3 bytes
wBitsPerSample18 0024
cbSize16 0022
wValidBitsPerSample18 0024
dwChannelMask3F 00 00 005.1
SubFormat16 bytesPCM
© 2026 fileformats.org About Contact Made by Lewpen