SF2 vs SFZ: what's the difference?
SF2 and SFZ both turn recorded samples into playable instruments. They differ in how they're packaged. An SF2 is one binary file with everything inside, while an SFZ is a short text file that points to a folder of separate samples. I added SFZ support to simpleSF2, my SoundFont player, in version 0.7.0, covering 688 of the format's 713 opcodes, so what I say about SFZ here comes from building that.
By Aiden Shihadeh, developer of simpleSF2 · Published · Updated
Quick answer
| SF2 | SFZ | |
|---|---|---|
| What it is | One binary file: samples and settings together | A text file plus a folder of sample files |
| Samples | 16-bit PCM inside the file (24-bit from version 2.04) | Separate WAV, FLAC or Ogg files, depending on the player |
| Editing | Needs a SoundFont editor such as Polyphone | Any text editor |
| Round robins, release samples | Not part of the format | Built in |
| Best for | General MIDI banks, retro and game sounds, sharing one file | Large, detailed multisampled instruments |
| Plays both | simpleSF2, as an AU, VST3 or CLAP plugin, with no conversion | |
SF2: everything in one file
SF2 is the SoundFont 2 format, created by E-mu Systems and Creative Labs for Sound Blaster sound cards in the 1990s. An SF2 file packs three layers into one binary file: the audio samples, instruments that map those samples across the keyboard, and presets that you pick and play. A single file can hold one instrument or a full General MIDI bank of 128 sounds plus drum kits. More about what's inside an SF2 file.
- It's easy to share, because there's only one file to keep track of and nothing to relink.
- Bank and program numbers are part of the format, which is why SF2 is the usual choice for General MIDI sets and for playing MIDI files.
- It's hard to edit by hand. You need a SoundFont editor such as Polyphone to change a sample, key range or envelope.
- Samples are stored as 16-bit PCM, or 24-bit in files that use version 2.04 of the specification.
simpleSF2 plays both formats in any DAW on Windows, macOS and Linux. Download free
Unlock multiple libraries, 16-channel multitimbral mode, and reverb and chorus for £9.99. One-time purchase.
Unlock 16 channels + reverb — £9.99SFZ: a text file and a folder of samples
SFZ was created by René Ceballos at rgc:audio and later extended by Cakewalk. An SFZ instrument is a plain text file of "opcodes" that say which sample plays on which keys and velocities, and how it should sound. The samples themselves sit next to it as ordinary audio files. The format is documented at sfzformat.com.
A minimal SFZ looks like this:
<region> sample=piano_C4.wav lokey=58 hikey=63 pitch_keycenter=60
<region> sample=piano_F#4.wav lokey=64 hikey=69 pitch_keycenter=66
- To change a key range or swap a sample, you open the file in any text editor, edit it, save and reload.
- SFZ has opcodes for round robins
(
seq_length), random sample choice, release samples and keyswitches. SF2 has no built-in way to do these. - Samples aren't packed into one file, so big multisampled libraries of many gigabytes are common.
- There's more than one file to keep track of. If you move the SFZ without its sample folder, or rename the folder, the instrument can't find its samples.
Which should you use?
- I'd use SF2 for General MIDI banks, retro and game-style sounds, playing MIDI files, and anything you want to share or back up as a single file. Most free SoundFonts you'll find online are SF2 (here are the best free ones).
- I'd use SFZ for detailed sampled instruments like pianos, drums with round robins, or orchestral libraries, and when you want to build or tweak an instrument yourself.
Often you don't get to choose, because the instrument you want comes in one format or the other, so it helps to have a player that opens both.
How to play SF2 and SFZ files in your DAW
Few DAWs can put either format straight onto a track. Logic's Sampler and FL Studio's DirectWave convert SF2 files into their own format, and Ableton Live can't open SF2 at all. simpleSF2 plays both formats as they are, as an AU, VST3 or CLAP plugin on Mac, VST3 or CLAP on Windows, and VST3, CLAP or a standalone app on Linux.
- Install simpleSF2 and add it to a MIDI or instrument track.
- Click Import SF2/SFZ and pick an
.sf2file, or the.sfzfile inside an SFZ instrument's folder. - Pick a bank and preset and play.
Step-by-step guides for each DAW:
Converting between SF2 and SFZ
My free SF2 to SFZ converter and SFZ to SF2 converter do it in your browser, and list anything they couldn't carry over. Polyphone, a free SoundFont editor for Mac, Windows and Linux, can also export an SF2 to SFZ and import an SFZ into an SF2. The conversion isn't perfect in either direction:
- Going from SF2 to SFZ usually works well for key ranges, loops and envelopes, but SF2 modulators and effects settings may not carry over exactly.
- Going from SFZ to SF2 drops anything SF2 can't express, such as round robins, release samples and keyswitches, and the samples are packed into one big file.
If you only want to play the instrument, I wouldn't convert it. Load the original file in a player that supports its format.
Common questions
Is SFZ better than SF2?
Neither is better across the board. SFZ can describe more detailed instruments and is easier to edit. SF2 is simpler to share, and it's the standard for General MIDI banks. The quality of an instrument depends far more on its samples than on the format.
What about SF3?
SF3 is a variant of SF2 that compresses the samples with Ogg Vorbis to make the file smaller. MuseScore uses it for its built-in sounds. Not every SF2 player opens SF3, so check before you rely on it.
Do I need a different player for each format?
No. simpleSF2, the player I make, opens both. It's free to download with one library per instance, and a one-time £9.99 unlock lets you import and switch between multiple libraries.
Why won't my SFZ load?
The usual cause is a missing sample. Keep the SFZ file and its sample folder together, with the same folder names the SFZ uses. If the instrument came as a zip, unzip all of it before importing.