Networking · Comparison
TCP vs UDP
The internet's two transport protocols. TCP guarantees that data arrives complete and in order; UDP just sends packets and moves on, which is faster and better for anything live.
2 options · 8 questions side by side · updated
| Compare | TCP | UDP |
|---|---|---|
| What it is | A reliable, ordered stream of data | Separate packets, each sent on its own |
| Connection | Handshake first, then a connection | None; packets simply go |
| Lost data | Detected and resent automatically | Gone, unless the app deals with it |
| Order | Always delivered in order | Can arrive out of order |
| Delay | Extra delay from handshakes and resends | Minimal |
| Header size | At least 20 bytes | 8 bytes |
| Used by | Web pages, email, SSH, file transfers | Video calls, live streams, games, DNS |
| Watch out for | One lost packet stalls everything behind it | No congestion control; some firewalls block it |
How to choose between TCP and UDP
- Pick TCP when every byte must arrive, as with web pages, files, payments and database connections.
- Pick UDP for live calls, video and games, where a late packet is worthless and low delay matters most.
- Newer protocols such as QUIC (behind HTTP/3) build their own reliability on top of UDP to get low delay and dependable delivery together.
The options
More comparisons
- Proxy vs VPN vs firewallThree tools that sit between a device and the network and are often confused. A proxy relays traffic, a VPN tunnels it with encryption, and a firewall decides what may pass at all.
- Cookies vs localStorage vs IndexedDBThree ways a website can keep data in the visitor's browser. They differ in size, in whether the data travels to the server, and in who can read it.
- Domain vs DNS vs hostingThree things people often buy from one company and so assume are one thing. The domain is the name, DNS is the signpost from the name to a server, and hosting is the server itself.
Crafted in the dark. Shipped to the world.
Tell us what you are building. You get a private project space with a proposal and a line-by-line quote within a day.