How to use the Base64 to WAV tool
- Copy the encoded sound from your API response, log or source file and paste it under Base64 or Base64 data URL.
- Select Decode file to rebuild the bytes and test them for a WAV header.
- Read the Result line. A valid file shows its size in bytes and the type audio/wav.
- Use the audio controls to play the sound, then select Download to save decoded.wav.
What a WAV file looks like inside
WAV is a RIFF container. The file opens with the four letters RIFF, a 32-bit little-endian length, and the four letters WAVE. After that come chunks. The fmt chunk states the sample format, channel count, sample rate and bits per sample. The data chunk holds the samples themselves, usually as plain PCM.
This tool decodes your Base64, then tests exactly those two markers: RIFF at byte 0 and WAVE at byte 8. It does not read the fmt chunk, so any sample rate, bit depth or codec inside the container is accepted and saved unchanged.
Worked example: decoding a 52 byte WAV
The string below is a complete WAV file with eight samples of silence. Decoded, the header reads RIFF, a length of 44 (the file size minus eight), WAVE, then a 16 byte fmt chunk that says PCM, one channel, 8000 Hz, 8 bits. The data chunk carries eight bytes of 0x80, which is the midpoint, and therefore silence, in unsigned 8-bit audio.
Every Base64 WAV starts with UklGR, the encoding of RIFF. The characters after that change with the file length.
Input:
UklGRiwAAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YQgAAACAgICAgICAgA==
Result: 52 bytes · audio/wav
File: decoded.wavBase64 to WAV size math
PCM audio is large, and Base64 adds a third on top. One second of CD quality sound (44,100 Hz, 16-bit, stereo) is 176,400 bytes, so a minute is about 10.6 MB of WAV and about 14.1 million Base64 characters. Speech at 16,000 Hz, 16-bit mono needs 32,000 bytes per second, or roughly 2.6 million characters per minute. A string far shorter than the duration suggests was truncated.
Why WAV decoding fails
The decoder reports The Base64 does not contain a WAV file when the two header markers are missing. These are the cases developers hit most.
- Raw PCM. Many speech APIs return headerless samples, often labeled LINEAR16 or pcm16. There is no RIFF header to find, so a 44 byte header must be added first.
- Another RIFF format. WebP images and AVI video also begin with RIFF, but bytes 8 to 11 read WEBP or AVI, not WAVE.
- RF64 or BW64 files. Broadcast tools write an RF64 marker in place of RIFF, which this check does not accept.
- Compressed audio labeled as WAV. An MP3 or Ogg stream with a .wav name still starts with its own signature.
- Damaged Base64. A stray quote, a percent sign from URL encoding or a missing character triggers Enter valid Base64 or Base64URL data.
Frequently asked questions
Does the WAV file get uploaded anywhere?
No. The page decodes the string with JavaScript and builds the file in memory. The player and the Download link both read from that local copy, so the audio stays on your device.
Why does the Result say audio/wav when my data URL said audio/x-wav?
The media type written in a data URL is ignored. The tool names the type from the bytes it decoded, and for a RIFF WAVE file it always reports audio/wav.
Can I play the decoded WAV before saving it?
Yes. An audio player appears under the Result box. Less common codecs stored in a WAV container may stay silent in the preview even though the downloaded file is intact.
How do I decode raw PCM that has no header?
This tool cannot, because it requires the RIFF and WAVE markers. Use Base64 to File to save the samples, normally as decoded.bin, then import them as raw data in an audio editor with the right sample rate, bit depth and channel count.
Does Base64 to WAV change the audio quality?
No. Base64 is a lossless text wrapper. Decoding returns the same bytes that were encoded, so the samples, header fields and any extra chunks such as LIST metadata are identical to the original file.