Upload a file
  1. base64hub
  2. File tools
  3. Base64 to WAV

Base64 to WAV

Paste a Base64 WAV to play it and download the .wav file. If it will not play, the header in the hex dump tells you why, and raw PCM without a header can be wrapped in a few lines of code.

Free no sign-up, no limits Local nothing uploaded Header codec, rate and channels in the hex dump Updated Oct 27, 2026
Input –Output –Size –

Processed in your browser. This page cannot send your data anywhere – how we know

How to decode Base64 to WAV

  1. Paste the Base64 into Base64 or data URI. A data:audio/wav;base64, or data:audio/x-wav;base64, prefix is fine.
  2. Play it in the player. Duration shows the length in minutes and seconds.
  3. Press Show hex dump to see the first 512 bytes; the next section explains what to look for.
  4. Press Download file to save the .wav.

Decoding and playback run in the browser. The page may not send data over the network except Cloudflare’s page-view count, so speech recordings stay on your device.

Reading the WAV header in the hex dump

A WAV file starts with a 12-byte RIFF header, usually followed directly by the fmt chunk that describes the audio. In the hex dump, these positions tell you what you have:

Offset (hex)BytesFieldExample: 16 kHz mono PCM
004RIFF52 49 46 46
084WAVE57 41 56 45
142Format code01 00
162Channels01 00 (mono)
184Sample rate80 3e 00 00 (16,000)
222Bits per sample10 00 (16)

All numbers are little-endian, so 80 3e 00 00 is 0x3e80, which is 16,000. The format code decides whether the browser can play the file:

Format codeCodecPlays in Chrome
01 00PCMYes
03 0032-bit floatYes
06 00, 07 00A-law, µ-law (telephony)Yes
02 00, 11 00Microsoft ADPCM, IMA ADPCMNo
31 00GSM 6.10No
fe ffExtensible: the real codec is named later in the chunk, usually PCMYes for PCM

Every browser plays PCM, but support for the other codecs differs, so test in the browser your listeners use. When the browser cannot decode a file, the note “Your browser can’t play this WAV file.” appears and Duration shows n/a. The download is still the correct file, and desktop players such as VLC handle all of these codecs.

The length follows from the header too: duration is the size of the data chunk divided by sample rate × channels × bytes per sample. Two seconds of 16 kHz mono 16-bit audio is 64,000 bytes of samples plus a header of at least 44 bytes.

Raw PCM without a header

Speech and voice APIs often return audio as bare 16-bit PCM samples at 16 or 24 kHz, with no RIFF header. Those bytes carry no signature, so the tool reports “This doesn’t look like WAV (detected: Binary)” and nothing will play them, even when saved with a .wav extension. Wrap them in a header using the sample rate, channel count and sample size from the API documentation:

import base64, wave

with open("speech.b64") as f:
    pcm = base64.b64decode(f.read())

with wave.open("speech.wav", "wb") as w:
    w.setnchannels(1)
    w.setsampwidth(2)
    w.setframerate(24000)
    w.writeframes(pcm)

setsampwidth(2) means 16-bit samples. Two seconds of 24 kHz mono audio, 96,000 bytes of PCM, becomes a 96,044-byte WAV that starts with UklGR and plays here and in any player. If the result sounds too fast, too slow or like noise, the sample rate or the sample format is wrong; try the other common rates or check whether the API sends 8-bit µ-law instead. More on Base64 in Python.

Other formats on a WAV page

If the data is a different audio format, the tool names it: “This looks like MP3, not WAV.” comes with a Download as .mp3 button, and the player works anyway. WAV files are large, so APIs and apps often switch to MP3 or Opus to save space, while documentation still says WAV. For the size difference and for encoding WAV files, see WAV to Base64; for all audio formats, Base64 to audio.

FAQ

How do I convert Base64 to a WAV file?

Paste the Base64 above and press Download file; the audio is saved as decoded.wav. Play it first in the player to make sure it is what you expect.

My Base64 should be a WAV but the tool says Binary. Why?

A WAV file starts with RIFF (UklGR in Base64). Without it you most likely have raw PCM samples, which many speech APIs return; add a header with the sample rate from the API documentation, as shown on this page.

Why does one WAV play and another one does not?

WAV is a container, and the codec is a number in its header. Plain PCM plays everywhere; ADPCM and GSM, common in old telephony and voicemail systems, usually do not play in browsers. Convert those with ffmpeg -i in.wav -c:a pcm_s16le out.wav.