Free tech learning for everyone, from basics to pro

Photo: Scott Rodgerson on Unsplash

ComparisonsBeginner

TCP vs UDP: what is the difference?

In short: TCP sets up a connection, numbers data and resends anything lost, so it suits web pages, email and file transfers. UDP just sends without checks, which suits DNS, voice, video and gaming where speed matters more.

Animation: TCP vs UDP at a glance. It plays on a loop with no sound.

TCP vs UDP in one sentence

TCP makes sure every piece of data arrives in order, while UDP sends data as fast as possible without checking it arrived.

Side-by-side comparison

FeatureTCPUDP
ConnectionYes, three-way handshake (SYN, SYN-ACK, ACK)No, connectionless
ReliabilityAcknowledges and resends lost dataNo resends
OrderData arrives in orderMay arrive out of order
Speed and overheadSlower, 20-byte header and moreFaster, 8-byte header
Flow controlYes (window size)No
Typical usesWeb (HTTP/HTTPS), email, SSH, file transferDNS, VoIP, video calls, streaming, gaming, DHCP
Example ports22, 25, 80, 44353, 67/68, 123, 161

What is TCP?

Transmission Control Protocol starts each conversation with a handshake, numbers every byte and waits for acknowledgements. Missing data is sent again, and the receiver puts everything back in order. That reliability is why web pages and downloads arrive complete.

What is UDP?

User Datagram Protocol simply sends each message, called a datagram, with no handshake and no resends. For a live call, a late packet is useless anyway, so it is better to skip it than wait. Applications that need some reliability on UDP add it themselves; for example, QUIC (used by HTTP/3) runs over UDP.

Which one should you use?

You rarely choose; the application does. As a rule: if every byte must arrive (files, web pages, email), it uses TCP. If speed and low delay matter more than the odd lost packet (voice, video, games, quick lookups like DNS), it uses UDP. When troubleshooting firewalls, always check whether a service needs TCP, UDP or both.

Common mistakes and myths

  • "UDP is unreliable, so it is bad." It is a design choice, perfect for real-time traffic.
  • Forgetting that DNS also uses TCP 53 for large answers and zone transfers.
  • Assuming HTTPS is always TCP: HTTP/3 uses QUIC over UDP 443.

Learn more

Key takeaways

  • TCP is connection-based and reliable; UDP is connectionless and fast.
  • TCP suits web, email and files; UDP suits DNS, voice, video and games.
  • HTTP/3 uses QUIC over UDP 443.
  • Firewall rules must match the right protocol.

About the author

Mohamed Fayas

Founder of FM TecHub. CCNA certified, with a BTEC HND in Network Engineering, and BEng (Hons) in Computer Networking and Cloud Security. He writes practical, plain-English guides on networking, security and cloud.

More about the author

© 2026 FM TecHub. Original content written for FM TecHub. Share the link freely; please don't copy the text elsewhere without permission.

Stay up to date by email

New notes, tools and security news from FM TecHub, explained simply. Free.

We only use your email to send these updates. See our privacy policy.