A codec (coder-decoder) turns your voice into data at one end of a call and back into sound at the other. The codec decides how natural a call sounds, how much bandwidth it uses, how it copes with a poor network and whether it works with the phone or provider at the other end. This guide compares the four codecs you'll meet most often in business VoIP and shows which to use on each kind of call.

What to compare in a codec

  • Audio bandwidth: the range of frequencies it reproduces. Narrowband is classic telephone sound, about 300 to 3,400 Hz, sampled 8,000 times a second. Wideband, often sold as HD voice, reaches about 7,000 Hz with 16,000 samples a second, so consonants such as "s" and "f" are much clearer.
  • Bitrate: how much data the codec itself produces per second. On the network, headers add a lot to this; our guide to VoIP bandwidth requirements does the full calculation.
  • Delay: the frame size plus any look-ahead the codec needs before it can encode.
  • Loss resilience: how well it hides lost packets, through packet loss concealment (PLC) or forward error correction (FEC).
  • Complexity and compatibility: CPU load, especially when the PBX has to convert between codecs, and whether every device on the call supports it.

G.711, G.729, G.722 and Opus at a glance

CodecAudioBitrateStrengthsWeaknesses
G.711 (PCMU and PCMA)Narrowband64 kbit/sSupported almost everywhere; no compression delay; very low CPU; carries fax and tonesHighest bandwidth for narrowband quality
G.729 (and G.729A)Narrowband8 kbit/sVery low bandwidthLower quality; poor with fax, modems and music on hold; quality drops with each re-encoding
G.722Wideband64 kbit/s (also 56 and 48)HD voice for the same bandwidth as G.711; low CPUFalls back to narrowband once a call leaves your network for the public phone network
OpusNarrowband to fullband6 to 510 kbit/s, adaptiveAdapts to the network; strong loss handling; royalty-free; required in WebRTCLess universal on desk phones and SIP trunks; often needs transcoding at the trunk

G.711: the universal baseline

ITU-T G.711 is pulse code modulation (PCM), the same coding the digital phone network has used for decades. It takes 8,000 samples a second at 8 bits each, which gives 64 kbit/s with no compression delay at all. It comes in two variants: μ-law (PCMU), used mainly in North America and Japan, and A-law (PCMA), used in most other countries. Match the variant your trunk provider uses, otherwise the PBX has to convert every call.

Use G.711 on your LAN, on SIP trunks and anywhere bandwidth isn't tight. Because it doesn't compress speech, it also carries fax and modem tones far better than compressed codecs. Keep it in every device's codec list as the fallback that almost everything understands.

G.729: when bandwidth is scarce

ITU-T G.729 compresses narrowband speech to 8 kbit/s using a method called CS-ACELP, which models the human voice instead of recording the waveform. It works in 10 ms frames of 80 bits each. Annex A is a lower-complexity version, the G.729A you'll see in most PBX menus, and Annex B adds silence suppression with comfort noise.

The savings are real but smaller than the bitrate suggests, because packet headers don't shrink: Cisco puts a G.729 call at 31.2 kbps on Ethernet against 87.2 kbps for G.711 at the usual 20 ms packet size. The costs are lower audio quality, poor handling of anything that isn't speech, and more CPU for the PBX if it has to transcode. Each extra compression stage on a call path also degrades the sound, so avoid chains such as G.729 to G.711 and back to G.729.

G.729 was a licensed codec for most of its history, which is why some platforms sold it per channel or left it out. Before you rely on it, confirm that your PBX, phones and trunk all support it. Use it for thin or congested links: a branch on a slow connection, satellite links, or a mobile user on weak data.

G.722: HD voice for desk phones

ITU-T G.722, titled "7 kHz audio-coding within 64 kbit/s", samples at 16,000 Hz and reproduces roughly double the frequency range of G.711. Voices sound fuller, names and numbers are easier to catch, and long calls are less tiring. It uses the same 64 kbit/s as G.711 and little CPU, which is why most current business desk phones support it.

The catch is that wideband only survives on legs where both ends support it. Calls to customers usually go out over the trunk as G.711, so the PBX converts them and the customer hears narrowband audio. G.722 shines on internal calls and calls between your own sites. One technical quirk: RTP labels G.722 with an 8,000 Hz clock rate even though it samples at 16,000 Hz, a historical error that RFC 3551 keeps for backward compatibility. Older recording and monitoring tools sometimes trip over it.

Opus: the adaptive codec

Opus, standardized by the IETF as RFC 6716, scales from 6 to 510 kbit/s and from narrowband to fullband audio, with frame sizes from 2.5 to 60 ms. It combines a speech layer derived from SILK with a music layer derived from CELT, and it can add in-band FEC: a low-bitrate copy of important speech is carried in the next packet, so a single lost packet can be rebuilt. For 20 ms frames, the RFC gives sweet spots of 8 to 12 kbit/s for narrowband speech and 16 to 20 kbit/s for wideband speech. The Opus project describes it as open and royalty-free.

WebRTC endpoints are required to implement Opus and G.711 (RFC 7874), so browser calling and many softphone apps default to Opus. The limitation is at the edges: desk phone support varies and many SIP trunks still expect G.711, so the PBX transcodes between them. That has a cost. Yeastar, for example, notes that enabling Opus transcoding on its P-Series uses more system resources such as memory.

Other codecs you'll see in the list

  • G.726: ADPCM at 16 to 40 kbit/s, mostly in older gateways and DECT systems.
  • GSM: the original 13 kbit/s mobile codec; acceptable, but rarely the best choice today.
  • iLBC: 13.33 or 15.2 kbit/s, designed to tolerate packet loss; now less common than Opus.
  • Speex: an earlier open codec from the same community as Opus, which has superseded it.
  • AMR-WB (G.722.2): the wideband codec behind mobile HD voice, covered in our guide to VoLTE.

How codec negotiation works

When a call is set up, one side offers a list of codecs in order of preference and the other side answers with the ones it accepts, as part of the SIP exchange. This happens on each leg separately: phone to PBX, and PBX to trunk. If two legs end up with different codecs, the PBX transcodes between them, which costs CPU, adds a little delay and can lower quality. Good codec ordering keeps transcoding to the calls that really need it.

Call legSuggested orderWhy
Desk phones on your LANG.722, then G.711HD voice internally, at no bandwidth cost on a LAN
SIP trunkThe provider's preferred codec, usually G.711 in your region's variant; G.729 only if bandwidth requires itAvoids transcoding at the busiest point
Mobile and remote appsOpus, then G.711; G.729 for very weak linksOpus copes best with variable networks
Browser (WebRTC) clientsOpus, then G.711The two codecs every WebRTC endpoint must support
Fax and analog gatewaysG.711, with T.38 where supportedCompressed codecs break fax tones

Common codec mistakes

  • A trunk set to G.729 only: calls fail when the far end can't match it. Always keep G.711 as a fallback.
  • Mismatched μ-law and A-law: every call is quietly transcoded for no benefit.
  • Silence suppression switched on by default: it saves a little bandwidth but can clip the first syllable of a sentence.
  • Expecting HD voice to customers: calls to the public network are usually narrowband, whatever your phones support.
  • Blaming the codec for network problems: choppy audio is usually packet loss or jitter, covered in fixing VoIP call quality.

For how codecs fit into the wider choice of trunks and phone systems, see SIP trunking explained and our business VoIP phone system guide.

How BtoBSkills can help

Codec settings are part of every trunk and extension we configure. With our VoIP support and configuration service, we review codec order on your phones, apps and trunks, remove unnecessary transcoding and troubleshoot call quality. Request a quote and tell us your PBX, provider and the devices you use.