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

CompareTCPUDP
What it isA reliable, ordered stream of dataSeparate packets, each sent on its own
ConnectionHandshake first, then a connectionNone; packets simply go
Lost dataDetected and resent automaticallyGone, unless the app deals with it
OrderAlways delivered in orderCan arrive out of order
DelayExtra delay from handshakes and resendsMinimal
Header sizeAt least 20 bytes8 bytes
Used byWeb pages, email, SSH, file transfersVideo calls, live streams, games, DNS
Watch out forOne lost packet stalls everything behind itNo 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

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.