texttoaudio.io

SoundFont to WAV

Turn the samples inside an SF2 SoundFont into separate WAV files. Choose a .sf2 file and this page lists its presets, instruments and samples with their sample rate, length, root note and loop points. Play any sample, save it as a 16-bit WAV, or save the whole list as one ZIP. Everything runs in your browser and the file is not uploaded.

SF2 in · WAV out · ZIP
runs in your browser · free
SoundFont file

Choose an .sf2 file. SF3 and sfArk files are not supported.

After the file loads, the sample list, filters and ZIP button appear below this box.

SoundFont to WAV: what you get

One WAV per sample, with the numbers the SoundFont itself lists.

How to use it

  1. Press the file box at the top and choose an .sf2 file from your device.
  2. In the sample list, press Play to hear a sample, or WAV to save it.
  3. Press the ZIP button to save every listed sample as a separate WAV file inside one archive.

Each WAV is a plain 16-bit PCM file at the sample rate stored for that sample in the SoundFont.

What the list shows

For every sample you see its name, sample rate, length in frames and seconds, the root key, the loop start and end if defined, and whether it is mono, left or right.

Root key is shown as a note name and a MIDI number, with middle C written as C4 and numbered 60.

Sample list after opening a small test SoundFont, showing four samples with name, sample rate, length, root key, loop points, type and Play and WAV buttons
Chrome test run with a tiny test SF2: four generated sine samples, including a left and right pair.

SF2 to WAV: how the extraction works

An SF2 file is a container, and the samples are stored in one block.

A SoundFont 2 file is a RIFF file whose form type is sfbk. Inside are three lists. INFO holds text such as the bank name and copyright line, sdta holds the audio in a chunk called smpl, and pdta holds the tables that describe how the audio is organised.

The smpl chunk is one long run of 16-bit signed little-endian numbers. Every sample in the bank sits inside it, one after another. The sample header table, shdr, gives each sample a name, a start and end position, loop positions, a sample rate, a root key, a pitch correction, and a link and type used for stereo. To make a WAV, this page copies the numbers between the start and end positions and puts a 44-byte WAV header in front of them.

Presets, instruments and samples

When you play a SoundFont in a synthesizer you choose a preset. A preset refers to one or more instruments, and an instrument divides the keyboard into zones that each use a sample.

Presets and instruments also hold envelopes, filters, key ranges and tuning. A SoundFont sample extractor like this one does not apply them. You get the raw recording, such as a drum hit or a single note.

ChunkWhat it holds
INFOVersion (ifil), bank name (INAM), sound engine (isng), and optional copyright and comment text.
smplAll sample audio, 16-bit signed little-endian, one run after another.
sm24Optional. The extra low 8 bits for 24-bit samples. Not used by this page.
phdr, pbag, pgenPresets: name, bank and program number, and the instruments each one uses.
inst, ibag, igenInstruments: their zones and which sample each zone plays.
shdrSample headers: name, start, end, loop, rate, root key, pitch correction, link, type.
SoundFont details panel and preset list, with the sample list limited to the instrument named Pad by the instrument menu, showing two samples
The same test file with the list limited to one instrument.

Stereo samples, loops and root notes

Three details that decide whether the saved WAVs are useful to you.

Stereo pairs

SF2 has no stereo sample type as such. A stereo piano, for example, is stored as two mono samples, one with type left and one with type right, and each header names the other in its link field. By default the page saves them as two mono WAV files, so nothing is mixed. If you tick the join option, pairs that point at each other and have the same rate and length become one interleaved stereo WAV. Anything that does not match stays mono.

Loops and root notes

Sustained instruments such as organs and pads usually loop a short stretch so a held key can keep sounding. The list shows the loop start and end in frames. The WAV contains the whole sample and does not repeat it, and the page does not write loop markers into the WAV.

The root key says which note the recording plays. A zone can override it, so the header value is a guide, not always the pitch you hear in a preset.

Page status line after pressing the ZIP button with the stereo join option ticked, reporting three WAV files saved
After saving the ZIP with the join option ticked: the pair became one stereo WAV, so three files for four samples.

SoundFont sample extractor: limits you should know

The page says what it cannot do rather than guessing.

  • SF3 is not supported. SF3 is an unofficial variant with Ogg Vorbis compressed samples. The page tells you when a file is SF3.
  • 24-bit is not supported. If the file has an sm24 chunk, the page exports the 16-bit part only and says so in the summary.
  • ROM samples cannot be saved. A few old banks refer to samples in hardware ROM. The file holds no audio for them, so they are marked.
  • Size. The whole file is read into your device memory, and the ZIP is built there too. Very large banks may be slow on a phone. One ZIP stays under 4 GB.

Licences and your own use

A SoundFont is a creative work with its own licence. Some are free for music but not for sharing raw samples, and some are for personal use only. Check the licence that came with the file, and the copyright text in its info, before you publish, sell or redistribute the extracted WAV files.

After you have the WAV files

To find the key and tempo of a loop you build from them, try YouTube to key and BPM, which also works on audio files from your device. To make a sound from scratch, see the car engine sound generator, which also saves a WAV. To put a short WAV into microcontroller firmware, use the WAV to C array converter. To make a Nintendo 3DS audio file, use MP3 to BCSTM.

SoundFont to WAV: questions

How do I convert a SoundFont to WAV?

Choose your .sf2 file on this page. The page reads it in your browser and lists every sample it contains. Press WAV on a row to save one sample, or press the ZIP button to save all of the listed samples as separate WAV files in one archive. The file is not uploaded.

Does the SoundFont to WAV tool upload my SF2 file?

No. The file is read with your browser's own file and audio functions, and nothing is sent to a server. The page does not use your text to speech allowance either.

How are stereo samples handled?

An SF2 file stores stereo sound as two separate mono samples, one marked left and one marked right, each pointing at the other. By default the page saves them as two mono WAV files. If you tick the join option, a left and right pair with the same sample rate and length is saved as one stereo WAV.

Which SoundFont files does it not support?

SF3 files, which hold compressed Ogg Vorbis samples, are not supported, and the page says so when you choose one. Samples stored in ROM are listed but cannot be saved because the file has no audio for them. For files with a 24-bit sm24 chunk the page saves the 16-bit part only.

Is the WAV the same audio as inside the SF2?

The 16-bit sample data is copied into the WAV unchanged, with the sample rate that the SoundFont lists for that sample. The page does not apply loops, envelopes, filters or effects, so a synthesizer note can sound different from the raw sample.

Can I use the extracted samples in my own music or product?

That depends on the licence of the SoundFont. Many are free for music but not for redistribution as samples, and some forbid it. Read the licence that came with the file, and the copyright text shown in the file's info, before you share or sell anything made from it.

More on the desk