WAV to Raw PCM Extractor

Paste an uncompressed WAV clip as base64 or hex and pull out only the `data` chunk — the bare interleaved PCM sample bytes, with the RIFF header and every other chunk removed. Copy the payload byte-for-byte or re-encode it to u8, s16, s24, s32 or float in either byte order, downmix or split channels, cut a frame window, and read back the ffmpeg / SoX / Audacity settings raw PCM needs. Runs entirely in your browser; the audio is never uploaded.

Try:
Raw PCM

About this tool

A .wav file is a RIFF container: a short header, a fmt chunk describing the sample layout, often a LIST/fact/cue chunk or two, and a data chunk holding the actual audio. Raw PCM is that data chunk on its own — no header, no metadata, just interleaved sample bytes. This tool walks the chunk chain of an uncompressed WAV you paste as base64 or hex and hands back only the payload.

With the defaults (Sample format = Source, Channels = All) the payload is sliced out byte-for-byte: nothing is decoded and nothing is re-encoded, so what you get is exactly what the container stored. Pick a different sample format and each sample is decoded and rewritten — u8, s16, s24, s32 or 32-bit float, in little- or big-endian — which is the same conversion ffmpeg -f s16le or sox -t raw would perform. Pick a channel selection and the clip is downmixed to mono or split to one side.

Four output shapes:

Everything runs locally in your browser using WebAssembly — the audio bytes are never uploaded.

Worked example

The base64 in the placeholder is a 16 kHz, mono, 16-bit WAV of three sample frames (16384, -8192, 0). The file is 50 bytes; the payload is the last 6. With the defaults the whole 44-byte header disappears and the output is:

AEAA4AAA

Switch Output as to Hex bytes and the same six bytes read:

00 40 00 e0 00 00

Switch Sample format to u8 — unsigned 8-bit and each 16-bit sample is requantised to one byte (163840.5192 = 0xc0):

c0 60 80

Choose Format report + re-import commands and nothing is dumped at all — you get the description a headerless file can't carry:

Source WAV
  file bytes      50
  codec           PCM integer (format tag 0x0001)
  sample rate     16000 Hz
  channels        1
  bit depth       16-bit
  block align     2 bytes per frame
  total frames    3
  duration        0.000188 s
  chunks          fmt (16 B), data (6 B)
  data chunk      offset 44, 6 bytes

Extracted PCM
  encoding        s16le (signed 16-bit little-endian), verbatim payload
  channels        1 interleaved (as stored)
  frames          3 of 3 (index 0 - 2)
  bytes           6

Re-import (raw PCM has no header — state the format yourself)
  ffmpeg          ffmpeg -f s16le -ar 16000 -ac 1 -i out.pcm out.wav
  sox             sox -t raw -e signed-integer -b 16 -L -r 16000 -c 1 out.pcm out.wav
  Audacity        Import > Raw Data: Signed 16-bit PCM, Little-endian, 1 channel, 16000 Hz

Embedding a clip in firmware

Set Output as to C array, pick the sample format your playback code expects, and use the bytes-per-line slider to control the wrapping. A stereo clip downmixed to mono at s16le, eight bytes per line, comes out as:

/* raw PCM: s16le, 1 channel, 16000 Hz */
const unsigned char pcm_data[] = {
  0x00, 0x00, 0x00, 0x40
};
const unsigned int pcm_data_len = 4;

Which WAV variants work

RIFF/WAVE PCM at 8, 16, 24 or 32-bit integer and IEEE float at 32 or 64-bit can be extracted and converted, including WAVE_FORMAT_EXTENSIBLE files whose real codec sits in the SubFormat GUID. A-law and mu-law WAVs can be extracted verbatim (Sample format = Source, Channels = All) but not converted — their samples are companded, not linear PCM, and the error says so. Compressed containers (MP3, AAC/M4A, Ogg Vorbis/Opus, FLAC, AIFF, big-endian RIFX) have no data chunk to strip; they are rejected with a message naming the format that was detected. Convert those first, e.g. ffmpeg -i clip.mp3 clip.wav.

Limits and edge cases

FAQ

How do I turn my .wav file into base64 to paste here?

There is no file upload — the tool takes a base64 or hex string. On macOS or Linux run base64 clip.wav (or xxd -p clip.wav for hex) and paste the output. On Windows PowerShell use [Convert]::ToBase64String([IO.File]::ReadAllBytes("clip.wav")). Then set Input encoding to match what you pasted.

How do I turn the base64 output back into a .pcm file?

Copy the result and run base64 -d > out.pcm (paste, then Ctrl-D), or on Windows certutil -decode out.b64 out.pcm. If you chose the hex output with Bytes per line set to 0, xxd -r -p out.hex > out.pcm does the same job. The file has no header, so anything that plays it needs the sample rate, channel count and encoding — the Format report output prints them.

Why is my raw PCM file silent, noisy, or the wrong speed?

Almost always a mismatch between the format the bytes really are and the format the player was told. Raw PCM has no header to correct a wrong guess: the wrong sample rate plays at the wrong speed, the wrong channel count swaps stereo into alternating garbage, and the wrong bit depth or byte order turns audio into static. Run the Format report output and copy the ffmpeg, SoX or Audacity settings it prints verbatim.

What is the difference between "Source" and picking a sample format?

Source copies the data chunk out byte-for-byte — no decode, no re-encode, so the output is bit-identical to what the file stored and the operation is lossless. Choosing an explicit format (s16le, u8, f32le, …) decodes every sample to an amplitude and rewrites it in that encoding, which is how you convert a 24-bit file down to 16-bit or flip byte order. Converting to a smaller depth loses precision; converting to the file's own format round-trips exactly.

Can I extract just a few seconds out of a long recording?

Yes — Start frame and Max frames cut a window. One frame is one sample per channel, so multiply seconds by the sample rate: at 44.1 kHz, second 10 to second 11 is start frame 441000, max frames 44100. Leave Max frames at 0 to run to the end of the clip. Windowing is also how you get a long file under the output size cap.

Why does my MP3, FLAC, or A-law file not work?

Only RIFF/WAVE files have a data chunk to strip. MP3, AAC/M4A, Ogg Vorbis/Opus, FLAC, AIFF and big-endian RIFX are detected by their signature and rejected by name, so you know what you actually pasted — convert them with ffmpeg -i clip.mp3 clip.wav first. A-law and mu-law WAVs are a special case: their payload can be extracted verbatim, but it cannot be converted to a linear PCM format here, because those samples are companded rather than linear.

Is my audio uploaded anywhere?

No. The extractor is compiled to WebAssembly and runs entirely in your browser tab. The WAV bytes you paste never leave your device, and there is no sign-up or server request.

Developer & Automation Access

Run it from the terminal

Same engine as this page, headless — via the gizza CLI:

gizza tool wav-to-raw-pcm-extractor "UklGRi4AAABXQVZFZm10IBAAAAABAAEAgD4AAAB9AAACABAAZGF0YQYAAAAAQADgAAA="

New to the CLI? Get gizza →

Open it by URL

Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:

https://gizza.ai/tools/wav-to-raw-pcm-extractor/?input=UklGRi4AAABXQVZFZm10IBAAAAABAAEAgD4AAAB9AAACABAAZGF0YQYAAAAAQADgAAA%3D&input_format=base64&output=base64&sample_format=source&channels=all&start_frame=0&max_frames=0&line_bytes=16

Machine-readable descriptor: tool.json — title + parameters JSON Schema for agents.