# HTTP/3

> The HTTP/3 is the third major version of the HTTP protocol that runs over QUIC instead of TCP.

## What is HTTP/3 and how is it different from HTTP/2?

The version of HTTP that works over the QUIC protocol based on UDP. Removes the head-of-line blocking of TCP, sets up connections faster and keeps them alive when the network changes, for example from Wi-Fi to mobile data.

- Topic: Communication Protocols
- Type: protocol

## Example

Wrong:

```nginx
server {
  listen 443 quic reuseport;
  server_name example.com;
}
```

Right:

```nginx
server {
  listen 443 ssl;
  listen 443 quic reuseport;
  add_header Alt-Svc 'h3=":443"; ma=86400';
  server_name example.com;
}
```

Browsers discover HTTP/3 through `Alt-Svc` on a TCP response, so the TLS listener must stay and advertise it.

## Common mistakes

- Turning on HTTP/3 while UDP is blocked, so clients silently fall back.

## Key points

- The server advertises HTTP/3 with the `Alt-Svc` header or an HTTPS DNS record.
- Firewalls allow UDP on port 443, and HTTP/2 stays available as a fallback.

## Interview questions

### Why does my site still load over HTTP/2 after enabling HTTP/3?

The first visit uses TCP, and the browser switches only after it sees `Alt-Svc`. If UDP is blocked on the network, it keeps using HTTP/2.

### Is HTTP/3 always faster than HTTP/2?

No, the biggest gains are on lossy or changing mobile networks. On stable, fast connections the difference is often small.

## Related cards

- [QUIC](https://wonderium.dev/web/quic.md)
- [HTTP/2](https://wonderium.dev/web/http-2.md)
- [UDP](https://wonderium.dev/web/udp.md)
- [TLS](https://wonderium.dev/web/tls.md)
- [WebTransport](https://wonderium.dev/web/webtransport.md)

---

- Level: [Web Platform](https://wonderium.dev/web.md)
- HTML version: https://wonderium.dev/web/http-3
- Last updated: 2026-11-25
