Skip to content
We areTOP 1%

What is the difference between TCP and UDP?

EasyConceptTCP & UDP
Track your progress
First attempt
Re-solve after a few days
Final pass before interviews

Answer

TCP (Transmission Control Protocol) is connection-oriented and reliable: it sets up a connection first and guarantees that data arrives complete and in order. UDP (User Datagram Protocol) is connectionless and unreliable: it sends independent messages, called datagrams, with no guarantee of delivery or order.

TCPUDP
Connectionthree-way handshake firstnone
ReliabilityACKs and retransmissionnone; lost data stays lost
Orderingdelivered in ordermay arrive out of order
Overhead20–60 byte header, slower8-byte header, faster
Typical usesweb (HTTP), file transfer, emailDNS, live video and voice calls, online games
  • TCP's guarantees cost extra round trips, and waiting whenever a packet is lost.
  • UDP suits traffic where speed matters more than perfection, or where the application adds only the reliability it needs, as QUIC (used by HTTP/3) does.

Example: Downloading a PDF uses TCP: one missing byte would corrupt the file, so it is worth waiting for a retransmission. A video call uses UDP: if a fragment of audio is lost, playing it half a second late would be worse than simply skipping it.

More in TCP & UDP

Sign in to track your progress

Your checkboxes, streak and activity heatmap are saved to your account and sync across devices. It is free.
Sign in with email

New here? Create an account