How it works
A web page asks for the camera and microphone (getUserMedia) and opens an RTCPeerConnection to the other person. Media travels as encrypted SRTP, usually straight from peer to peer over UDP, with Opus for audio and VP8, VP9, H.264 or AV1 for video. Data channels carry chat messages, files or game state over the same connection.
WebRTC deliberately leaves signalling to you: before connecting, the two sides must swap connection details (SDP offers and answers) through your own server, usually over WebSockets. To get past home routers and firewalls it uses ICE, which tries direct routes discovered with STUN servers and falls back to TURN servers that relay the media. A share of calls always needs a relay, so production apps budget for TURN.
Peer to peer suits one-to-one calls. Group calls usually go through an SFU (selective forwarding unit), a server that receives each person's stream once and forwards it to everyone else; LiveKit, Janus, mediasoup and Cloudflare Realtime provide one. Google Meet and Discord both run on WebRTC.
WebRTC pros and cons
Pros
- Built into browsers, so people need no app or plugin
- Encryption is mandatory for all audio, video and data
- Low delay, designed for live conversation
- Free and open, with open-source libraries for mobile and servers
Cons
- Signalling is left to you, so there is still a server to build
- Needs STUN and TURN servers, and relayed traffic costs money
- Group calls need an SFU, because pure peer to peer stops scaling after a few people
- Differences between browsers and networks make problems hard to debug
When to use WebRTC
Pick it when
- Video or audio calls inside a web or mobile app
- Screen sharing, live tutoring or consultations in the browser
- Low-delay peer-to-peer data, such as multiplayer games or file transfer
Skip it when
- Broadcasting one stream to thousands of viewers, where HLS is simpler and cheaper
- Text messages only, with no audio or video, where WebSockets are simpler
WebRTC pricing
Free
Free and built into browsers. TURN relays cost money: coturn is free software but needs a server and bandwidth, and Cloudflare's TURN service charges about $0.05 per GB after the first 1,000 GB each month.
WebRTC pricing page (opens in a new tab)Approximate, checked September 2026.What the other tools cost
Related terms
More in Backend and APIs
Realtime