G.711 is a legacy audio codec that is mandatory to implement in WebRTC alongside Opus.
G.711 operates at a fixed 64 kbps bitrate using narrowband audio (8 kHz sampling rate). It comes in two flavors: G.711 u-law (used in North America/Japan) and G.711 A-law (used elsewhere).
Why G.711 is in WebRTC
G.711 is the universal codec of the telephone world. Including it in WebRTC ensures interoperability with:
Without G.711 support, a gateway would always need to transcode between WebRTC and telephony, adding latency, cost, and complexity.
G.711 vs Opus
In practice, WebRTC-to-WebRTC calls almost always use Opus, which offers dramatically better quality at lower bitrates. G.711 is only used when connecting to legacy systems that do not support Opus. Opus at 16 kbps provides comparable quality to G.711 at 64 kbps while supporting wideband audio.
For the most part, it is advisable to use Opus instead of G.711 even when connecting to PSTN. This adds more resiliency and lowers the bitrate on the WebRTC leg when using Opus.


