
What is WebRTC? It’s the open technology that lets one browser send live video, voice, and data straight to another browser: no plugin, no app, no download. When you join a Google Meet in a tab or drop into a Discord voice channel, WebRTC is the plumbing making it work. This guide explains what WebRTC is and how it actually works, in plain English, for anyone who has to make product or budget calls without being a network engineer.
Key takeaways
• WebRTC is real-time media, built into the browser. It became a joint W3C and IETF standard in January 2021 and now ships in Chrome, Firefox, Safari, Edge, and Opera.
• It’s three JavaScript APIs on top of proven protocols. getUserMedia grabs your camera, RTCPeerConnection makes the link, RTCDataChannel moves data — over ICE, STUN, TURN, DTLS, and SRTP.
• The hard part is connecting through NAT. Home and office routers hide your device, so WebRTC uses STUN to find your public address and TURN to relay media when a direct path fails.
• Encryption is mandatory. Every WebRTC stream is encrypted with DTLS and SRTP; browsers reject anything unencrypted. True end-to-end privacy needs an extra layer (SFrame).
• Latency is its edge, scale is its catch. WebRTC hits 200–500 ms glass-to-glass, but past a handful of peers you need an SFU — and TURN bandwidth becomes your biggest bill.
What is WebRTC?
WebRTC (Web Real-Time Communication) is an open, royalty-free standard that lets browsers and apps exchange audio, video, and arbitrary data directly between users, in real time, without plugins or extra software. It was published as a joint standard by the World Wide Web Consortium (W3C) and the Internet Engineering Task Force (IETF) in January 2021, and it runs natively in every major browser.
Here’s the useful way to think about it: WebRTC isn’t one thing. It’s a bundle of existing networking protocols (the same building blocks telecoms have used for years), wrapped in three JavaScript functions your browser already knows. That’s why a video call “just works” in a tab: the browser does the heavy lifting, and the website only asks it to start.

Figure 1. WebRTC is three JavaScript APIs sitting on a stack of proven networking protocols — the browser wires them together for you.
Two things make WebRTC special versus older approaches like Flash or a downloaded desktop client. First, it’s native to the browser — nothing to install. Second, it can connect two users peer-to-peer, so their audio and video can travel directly between them instead of routing through a central server. That direct path is what delivers sub-second latency. It’s also what makes WebRTC surprisingly tricky under the hood, as we’ll see.
What is WebRTC used for?
WebRTC powers most of the real-time audio and video you already use. Google Meet, Microsoft Teams, Facebook Messenger, Discord, WhatsApp, and Snap all run their calling features on it. If a product has a “join call” button that opens in a browser, it’s almost certainly WebRTC underneath.
Beyond consumer chat, four use cases dominate in 2026:
1. Video conferencing and collaboration. Group calls, screen share, whiteboards, breakout rooms. This is WebRTC’s home turf and where most of the ecosystem’s tooling lives.
2. Telehealth. A doctor and patient on a HIPAA-compliant video visit, remote patient monitoring, secure messaging. Low latency matters here because a laggy consult feels broken, and browser-native means patients don’t install anything.
3. AI voice agents. The fastest-growing category. A caller talks to an AI over WebRTC, and the audio streams to a speech model and back with barely any delay. This is where much of the 2026 build activity has moved, and it’s why we spend a lot of our time on real-time AI integration.
4. Live streaming and data. Interactive low-latency streams (auctions, betting, watch-parties), plus the data channel for file transfer, live cursors, and multiplayer state.
Building anything real-time?
We’ve shipped 250+ video and real-time products since 2005. Tell us what you want users to do — call, stream, or talk to an AI — and we’ll map the WebRTC stack you actually need.
Why real-time in the browser used to be hard
Before WebRTC, live video in a browser meant a plugin (Flash, Silverlight, or a Java applet) that users had to install and trust, and that broke every time the plugin updated. WebRTC killed the plugin. But it inherited a much older problem the plugin era never really solved: the modern internet is not built for two random computers to call each other directly.
The reason is NAT (Network Address Translation). There aren’t enough public IPv4 addresses for every device on Earth, so your router hands out private addresses (like 192.168.0.20) to everything in your home or office, and presents a single public address to the outside world. It works beautifully for browsing websites. It quietly breaks direct calls, because your laptop’s private address means nothing to a laptop on someone else’s network.
Everything WebRTC does to “connect” — ICE, STUN, TURN, the whole cast, exists to get around this one problem. Understand NAT and the rest of WebRTC falls into place. So the rest of this guide walks the connection from start to finish, then covers scale, security, and cost.
How does WebRTC work?
A WebRTC call comes together in four steps: capture the media, signal to swap connection details, connect through NAT, then stream encrypted media directly between peers. The first three set up the call; the fourth is the call itself.

Figure 2. The four steps of a WebRTC call. Note that step 2, signaling, is not part of the WebRTC standard — you build it.
In code, the caller’s side looks roughly like this (the full APIs live in the MDN WebRTC docs): call getUserMedia() to get the camera and mic, create an offer, send it to the other person, receive their answer, exchange network addresses, and let the media flow. The receiver mirrors it. It sounds like a lot, but there are really only three moves: send your media, agree on the connection, receive their media. The messy middle move — agreeing on the connection — is what SDP, ICE, STUN, and TURN handle.
Signaling: the part WebRTC leaves to you
Before two peers can talk, they have to exchange a bit of setup information: what codecs they support and where they can be reached. That exchange is called signaling — and here’s the surprise: signaling is not part of WebRTC. The standard deliberately leaves it out.
Why? Because every app already has a way to pass messages between users — a WebSocket, an HTTP endpoint, even a chat server. WebRTC assumes you’ll reuse yours. Its only requirement is that you carry two kinds of message between the peers: the SDP (what media they’ll send) and the ICE candidates (how to reach them). You could, in theory, read those aloud over the phone and type them in by hand, and the call would connect.
Reach for a plain WebSocket signaling server when: you control both endpoints, you want the smallest moving part, and you’re fine writing the offer/answer relay yourself — it’s often under 100 lines.
What is SDP in WebRTC?
SDP (Session Description Protocol) is the text document two peers swap to agree on what they’ll send each other — codecs, resolutions, and formats. It describes the media, not the media itself. Think of it as two people comparing notes before a call: “I can do H.264 and VP8 video and Opus audio; what about you?”
The handshake is an offer and an answer. The caller creates an offer describing everything it can send, the callee replies with an answer picking what it can handle, and both sides install both descriptions. If the caller supports codecs A and B and the callee supports B and C, they settle on B. After this, the two peers know exactly how they’ll talk — a logical connection exists. What’s still missing is the actual network path, which is where ICE comes in.
NAT: why peers can’t just call each other
To see why a direct connection is hard, walk through three common setups. In each, two peers — call them P1 and P2 — try to reach each other.
| Setup | What happens | Can they connect directly? |
|---|---|---|
| Same network | Both on the same office Wi-Fi, private IPs visible to each other. | Yes — straight over their local IPs. |
| Different networks | One behind a home router, the other elsewhere. Private IPs are invisible across the internet. | Only with help discovering public addresses (STUN). |
| Both behind strict NAT | Two home or corporate networks; symmetric NAT or firewalls block unsolicited traffic. | Often no — media must be relayed (TURN). |
Table 1. The same call gets harder as more NAT sits between the peers.
The middle case is the interesting one. Each router has an internal face (say 192.168.0.1) and an external, public face (say 203.0.113.5). Private addresses can’t be routed across the internet, and many devices share one public address, so the router uses port numbers to keep track of which internal device each conversation belongs to. WebRTC has to discover those public address-and-port combinations before a peer can be reached. That’s the job of ICE candidates.
What are ICE candidates in WebRTC?
An ICE candidate is one possible way to reach a peer — an IP address, a port, and a transport (UDP or TCP). WebRTC gathers every address a peer might be reachable on, sends them all to the other side, and lets both ends probe until they find a pair that works. ICE stands for Interactive Connectivity Establishment (RFC 8445), and it’s the reason WebRTC connects across networks that “shouldn’t” be reachable.
A single peer usually has several candidates, because it can be reached in more than one way. There are three main types:
| Candidate type | Where the address comes from | When it works |
|---|---|---|
| host | The device’s own local IP. | Same LAN only. |
| server-reflexive | Public IP:port discovered via a STUN server. | Across most home and mobile NATs. |
| relay | An address on a TURN server that forwards media. | Always — but you pay for the bandwidth. |
Table 2. The three ICE candidate types, cheapest to most expensive.
ICE tries them in order of preference: host first (free, fastest), then server-reflexive, then relay as a last resort. Each side gathers its own candidates and hands them to the other; you take the peer’s candidates as-is rather than editing them. Candidates are usually added after the SDP, because the logical connection has to exist before there’s a path to attach it to.
What are STUN and TURN servers?
A STUN server tells a peer its own public IP address and port; a TURN server relays the media when no direct path exists. Together they’re called ICE servers, and you configure them when you set up a connection. Skip them, and only peers on the same local network will ever connect.

Figure 3. STUN discovers your public address; TURN relays your media when direct connection is impossible.
How a STUN server works, packet by packet
Say peer P1 (192.168.0.20:35777) sits behind router R1 and wants to know its own public address. It sends a small packet to a STUN server. Watch what the router does to the packet header on the way out and back:
| Step | Source (from) | Destination (to) |
|---|---|---|
| P1 sends to STUN | 192.168.0.20:35777 | 198.51.100.10:3478 (STUN) |
| Router R1 rewrites it | 203.0.113.5:888 (public) | 198.51.100.10:3478 (STUN) |
| NAT table remembers | 203.0.113.5:888 → 192.168.0.20:35777 | |
| STUN replies (“you are 203.0.113.5:888”) | 198.51.100.10:3478 | 203.0.113.5:888 |
Table 3. The STUN round-trip. The router swaps P1’s private source for its public one and remembers the mapping, so the reply finds its way back.
The STUN server simply reports back the source address it saw — 203.0.113.5:888 — which is P1’s public face. P1 turns that into a server-reflexive candidate and shares it. Now other peers have an address that can reach it through the router. STUN is cheap: it’s a tiny exchange, and it never touches your media.
When STUN isn’t enough: TURN
Some routers are stricter. A symmetric NAT remembers not just your internal address but the exact remote destination, so a packet from a different source is dropped — even if it’s the peer you’re trying to reach. Corporate firewalls and some mobile carriers behave the same way. When a direct path can’t be found, WebRTC falls back to a TURN server, which sits on the public internet and relays every packet between the two peers. To the peers it feels like a direct call; in reality the TURN server is in the middle, forwarding bytes. Every TURN server can also act as a STUN server, but not the reverse.
Reach for TURN when: your users are on corporate networks, mobile data, or VPNs — anywhere direct UDP is blocked. Plan for 15–40% of connections to relay in a consumer app, and up to ~85% inside strict enterprise networks.
Media streams and tracks
Once peers are connected, what actually flows is a MediaStream — a container for audio and video. A stream is local (from your camera and mic) or remote (arriving over the network), and most nodes have one of each. Inside a stream are tracks: one for video, one for audio, each of which can be enabled or disabled independently.
The one rule worth remembering: tracks in the same stream stay in sync; tracks in different streams don’t. So if you’re sending your face and your voice and they must line up, put them in one stream. If you’re also sharing a document camera that doesn’t need to be lip-synced, make it a second, independent stream — playback stays smoother that way. Each track carries a kind (audio or video) and a label so the other side can tell them apart.
P2P vs SFU vs MCU: how WebRTC scales
WebRTC is peer-to-peer by default, and that only scales to a handful of people. Past that, you add a media server — an SFU for most cases, an MCU for the rest. This is the single biggest architecture decision in any WebRTC product, so it’s worth understanding the trade-off.

Figure 4. Three topologies for the same four-person call. Each trades client bandwidth for server cost.
| Topology | How it routes | Client load | Server load | Best for |
|---|---|---|---|---|
| P2P mesh | Every peer sends to every other peer. | Heavy (N−1 uploads) | None | 1-to-1, 2–4 people |
| SFU | Each peer uploads once; server forwards copies. | Light (1 upload) | Moderate (forwards) | Group calls, webinars |
| MCU | Server mixes all streams into one. | Lightest (1 up / 1 down) | Heavy (mixes video) | Weak devices, phone bridges |
Table 4. P2P vs SFU vs MCU at a glance. For a deeper dive, see our P2P vs MCU vs SFU guide.
Reach for an SFU when: your calls have more than four people, or you need recording, simulcast, or server-side features. Mesh chokes past four because every extra person adds an upload to every other person’s connection.
Is WebRTC secure?
Yes — WebRTC encrypts every stream by default, and there is no way to turn it off. The IETF security architecture (RFC 8827) requires DTLS to exchange keys and SRTP to encrypt the media, and browsers reject any WebRTC connection that tries to skip it. So the media between two peers is always encrypted in transit. That’s a stronger baseline than most protocols, which treat encryption as optional.
There’s an important nuance, though. DTLS-SRTP encrypts the hop between a peer and the server. If your call runs through an SFU — and most group calls do — that server decrypts and re-encrypts the media to forward it, so the operator can technically see it. For true privacy where even the server can’t peek, you add end-to-end encryption (E2EE) with SFrame (standardized as RFC 9605 in August 2024), which encrypts each media frame end-to-end — on top of the default DTLS-SRTP — so the server forwards bytes it can’t read. The standardized WebRTC Encoded Transform that makes this possible ships in Chrome, Edge, Firefox, and Safari; Chrome and Edge also expose an older Insertable Streams flavor of the same idea.
One more thing worth knowing: WebRTC can expose your device’s local and public IP addresses to a web page through the STUN process — the so-called “WebRTC leak” that privacy tools warn VPN users about. It’s a metadata concern, not a media-decryption one, and it’s manageable, but it’s real. For the full picture on keys, fingerprints, and compliance, see our WebRTC security explainer and the plain-language guide to E2EE, HIPAA, and GDPR.
Need WebRTC that holds up under audit?
HIPAA, GDPR, SOC 2, end-to-end encryption — we’ve shipped compliant real-time media for telehealth and enterprise. Bring us your requirements and we’ll tell you what’s realistic.
WebRTC vs HLS vs WebSocket: which do you need?
Use WebRTC when people need to interact in real time; use HLS when you’re broadcasting to a big audience; use WebSockets for the data and signaling around the media, not the media itself. They’re not competitors so much as tools for different jobs.
| Protocol | Latency | Scales to | Best job |
|---|---|---|---|
| WebRTC | 200–500 ms | Small groups (with an SFU, hundreds) | Two-way calls, interactive streams |
| HLS | 15–30 s | Millions | One-to-many broadcast, VOD |
| LL-HLS | 2–5 s | Millions | Large low-latency broadcast |
| WebSocket | Low | Many | Signaling, chat, live data — not video |
Table 5. Pick by latency and audience size. Full breakdown in our WebRTC vs HLS guide.
Reach for HLS instead of WebRTC when: you’re streaming to thousands of viewers who only watch, a few seconds of delay is fine, and you want it to play on every device with no fuss. WebRTC’s low latency stops being worth its cost the moment nobody needs to talk back.
What does a WebRTC app cost to run?
Direct peer-to-peer calls are nearly free to run — the media never touches your servers. Your bill starts the moment traffic has to be relayed through TURN or an SFU, and relay bandwidth is usually the biggest line item. That’s the number to model early.

Figure 5. The same relayed workload costs nearly 8× as much on one provider as another. Provider choice, not code, drives the bill.
Here’s the arithmetic, spelled out. Say you have 1,000 users on 30-minute calls a day — that’s 500 user-hours a day, or 15,000 a month. Assume ~30% of connections need TURN relay (a fair consumer average), so about 4,500 of those hours actually relay. A 720p stream relayed both ways runs about 1.5 GB per hour. So:
- 4,500 relayed hours × 1.5 GB = 6,750 GB/month of relay traffic.
- On Cloudflare’s TURN at $0.05/GB: ~$338/month (their first 1 TB each month is free, so the real bill is lower still).
- On AWS at ~$0.09/GB: ~$608/month.
- On Twilio at ~$0.40/GB: ~$2,700/month — same bytes, nearly 8× the cost.
The lesson isn’t “pick the cheapest.” It’s that provider choice, relay percentage, and video resolution swing the bill far more than your code does. Above roughly 5 million relayed minutes a month, running your own coturn servers on dedicated boxes usually beats managed TURN — below that, managed wins on total effort. We work through this math per project in our WebRTC development cost breakdown.
When NOT to use WebRTC
WebRTC is the right tool often, but not always. Being honest about where it’s the wrong choice saves money and rebuilds.
1. One-to-many at massive scale. Broadcasting one stream to 50,000 passive viewers? That’s HLS or LL-HLS territory. WebRTC’s per-connection overhead and relay costs make it the expensive way to do a job HLS does cheaply.
2. Server-to-server media. If both ends are your own backends, the browser stack buys you nothing. Use a media server SDK or plain RTP; skip the NAT-traversal machinery.
3. Simple, non-real-time data. If you just need to push text updates or notifications, a WebSocket is simpler and lighter than opening a data channel.
4. You want zero infrastructure. “Peer-to-peer” sounds serverless, but any real product still needs signaling, STUN, TURN, and usually an SFU. If you don’t want to run that, a managed platform is the honest answer — more on that next.
Is WebRTC right for you? A five-question framework
Run your idea through these five questions to know quickly whether WebRTC fits — and what shape it should take.
1. Do users need to interact live, or just watch? Interact → WebRTC. Watch only → HLS.
2. How many people share a call? Two to four → P2P is fine. More → you need an SFU.
3. Where are your users? Corporate, mobile, or VPN-heavy → budget for heavy TURN relay.
4. What’s your compliance bar? HIPAA or true privacy → plan for E2EE with SFrame, not just default encryption.
5. What’s your timeline and team? Weeks and a small team → start on a managed SDK. Months and specific control needs → consider custom.
How WebRTC looks at real scale: BrainCert
Theory is one thing; a live product with hundreds of millions of minutes is another. BrainCert is an education platform with virtual classrooms — live video, screen share, and an interactive whiteboard, all in the browser on WebRTC. Fora Soft is a software development company that has built video and real-time communication products since 2005, and we’ve been the engineering team behind BrainCert — the numbers show what the technology can carry.
The situation was a familiar one: real-time classrooms that had to work for a global audience on mixed networks (school Wi-Fi, home broadband, mobile) without students installing anything. That meant an SFU for group classes, TURN sized for the share of users behind school firewalls, and recording built in. The plumbing we’ve walked through in this guide is exactly what made it hold together.
The outcome: BrainCert reached $3M ARR in 2024 (up 58% year over year), serves 100,000+ customers, and has delivered 500M+ classroom minutes over WebRTC. Want a similar assessment of your own real-time build? Book a 30-minute scoping call and we’ll sketch the architecture with you.
Build vs buy: SDKs and when to go custom
You rarely write raw WebRTC from scratch. Most teams start on a managed platform (LiveKit, Daily, Agora, Twilio, and the like) that hands you an SFU, TURN, SDKs, and dashboards for a per-minute fee. That gets a call on screen in days instead of months.
The trade-off is control and long-run cost. Managed platforms bill by the minute, so at high volume the bandwidth math starts to favor running your own stack on open-source pieces (mediasoup, Janus, coturn). Custom also wins when you need something the vendor doesn’t offer: a specific E2EE scheme, an unusual recording pipeline, on-prem hosting for compliance, or an AI model spliced into the media path. We build both ways and help teams pick — on mobile that means native WebRTC on iOS and WebRTC on Android, and when it’s time to hire, our guide to choosing a WebRTC development company lays out the questions to ask.
Reach for custom WebRTC when: your relayed minutes run into the millions per month, you need on-prem or a bespoke E2EE or AI pipeline, or a managed vendor’s per-minute pricing has become your top line cost. Below that, a managed SDK is the faster, cheaper start.
WebRTC FAQ
What is WebRTC in simple terms?
WebRTC is technology built into web browsers that lets people send live video, voice, and data straight to each other in real time, without installing a plugin or app. It’s what powers browser video calls like Google Meet and Discord.
Do I need to install anything to use WebRTC?
No. WebRTC is built into every modern browser — Chrome, Firefox, Safari, Edge, and Opera — so users just click a link. Developers may add libraries or SDKs for advanced features like recording or large group calls.
Is WebRTC free?
The WebRTC standard is open and royalty-free, and one-to-one peer connections cost almost nothing to run because media flows directly between users. You pay for infrastructure — TURN relay bandwidth and, for group calls, an SFU — not for the technology itself.
Is WebRTC secure?
Yes. WebRTC encrypts every audio, video, and data stream by default using DTLS and SRTP, and browsers refuse to run it unencrypted (per IETF RFC 8827). For privacy where even your server can’t see the media, add end-to-end encryption using Insertable Streams and SFrame (RFC 9605).
What are STUN and TURN servers for?
A STUN server tells your device its own public IP address so peers behind routers can find each other; it’s lightweight and cheap. A TURN server relays the actual media when a direct connection is impossible (strict firewalls, symmetric NAT), which is reliable but uses bandwidth you pay for.
What is the difference between SFU and MCU in WebRTC?
An SFU (Selective Forwarding Unit) receives one stream from each participant and forwards copies to the others, staying light on the server and ideal for most group calls. An MCU (Multipoint Control Unit) mixes all streams into a single one, which is heaviest on the server but easiest on weak devices and phone bridges.
What is a WebRTC leak?
A WebRTC leak is when a web page uses the STUN process to read your device’s local and public IP addresses, which can reveal your real location even behind a VPN. It exposes metadata, not your encrypted media, and browser settings or VPN tools can block it.
WebRTC vs WebSocket — what’s the difference?
A WebSocket is a two-way messaging channel between a browser and a server, which is great for chat, notifications, and WebRTC signaling. WebRTC is for live media (audio and video) sent peer-to-peer with far lower latency. Most real apps use both: WebSockets to set up the call, WebRTC to carry it.
What to read next
Architecture
P2P vs MCU vs SFU for video conferencing
The topology decision that shapes your whole stack, in depth.
Protocols
WebRTC vs HLS: which streaming protocol wins
Latency, cost, and scale compared for your app.
Security
WebRTC security in plain language
E2EE, HIPAA, GDPR, and the common attacks, explained.
Budget
WebRTC development cost in 2026
Startup vs enterprise pricing, with real numbers.
Hiring
Hire a WebRTC company or build in-house?
When to bring in specialists versus staffing it yourself.
So, what is WebRTC really?
WebRTC is the open standard that turned real-time video, voice, and data into something a browser does natively: no plugin, encrypted by default, and fast enough to feel live. The magic isn’t any single piece; it’s the way SDP, ICE, STUN, and TURN cooperate to punch a private device through NAT and open a direct, encrypted path to another one.
Once you see that, the product decisions get clearer: mesh for small calls, an SFU past four people, TURN sized to your users’ networks, HLS when the audience only watches, and E2EE when privacy has to be provable. Get those five right and WebRTC will carry you from a two-person prototype to hundreds of millions of minutes — we’ve done it enough times to help you skip the expensive detours.
Turning a real-time idea into a product?
We’ve built WebRTC video, voice, and AI systems since 2005 — 250+ projects, 100% Upwork success. Bring the idea; we’ll bring the architecture, the cost model, and the team.


