You're looking for a pancake recipe. You find a link, you tap it, and less than a second later the page is there: the photos, the ingredients, the little stack of pancakes.

It feels instant. But in that blink, your device asked for directions, shook hands with a computer it had never met, agreed on a secret code with it, and sent messages racing through cables, across cities and maybe under an ocean, and back again.

Let's slow that second down and follow your click, step by step.

Prefer to watch? This article goes with our animated explainer: What Happens When You Click a Link?

In short

  1. The link is an address. Your browser first needs to turn a name like example.com into a number (an IP address).
  2. DNS finds that number. DNS is the internet's phone book. It usually answers in a few milliseconds.
  3. A handshake opens a connection. Your data travels in small numbered packets, and anything lost is sent again.
  4. HTTPS makes it private. The site proves who it is with a certificate, and both sides agree on a secret key.
  5. Routers pass it along, hop by hop. Tens of thousands of independent networks carry your request.
  6. Often a nearby copy answers. Content delivery networks keep copies of pages close to you.
  7. The browser builds the page. It downloads dozens of files and paints them on your screen.

A link is really a URL, and it has three parts. Take https://example.com/pancakes:

  • https:// is how to talk: the protocol, in this case the secure version of the web's language.
  • example.com is who to talk to: the domain name.
  • /pancakes is what you want: the path to the page on that site.

Names like example.com are made for people. Computers on the internet don't find each other by name. They use numbers called IP addresses. The older kind is four numbers separated by dots, something like 93.184.215.14. The newer kind (IPv6) is a much longer string.

Think of the contacts on your phone. You tap "Mum", but what the phone actually dials is a number. So before anything else happens, your browser has a question: what is the number for example.com?

2. DNS: the internet's phone book

The system that answers that question is called DNS, the Domain Name System.

  1. Your device checks its own memory first. If you visited the site recently, it already knows the number.
  2. If not, it asks a resolver. That's a helper server, usually run by your internet provider or by a public DNS service.
  3. The resolver may not know either, so it starts at the top: the root servers. There are 13 of them by name, but each is copied many times over, so well over a thousand machines around the world answer as the "root".
  4. The root doesn't know example.com, but it knows who looks after everything ending in .com. It points the resolver to the .com servers.
  5. The .com servers don't know the full answer either, but they know which server is in charge of example.com. That's the domain's authoritative server.
  6. The authoritative server finally answers with the IP address.

That sounds like a long trip, but every answer gets remembered for a while (cached). Your device, your router and your resolver all keep recent answers. So most of the time, the whole lookup takes just a few milliseconds.

3. Packets and the handshake

Now your browser knows where to go. But it can't just shout a whole web page across the internet in one piece.

Everything online travels in small chunks called packets, typically up to about 1,500 bytes each. A single page can be split into hundreds or thousands of them. Each packet carries a label saying where it's from and where it's going.

Packets can get lost, or arrive in the wrong order. So before sending anything, your device and the server set up a connection using TCP, with a quick three-step handshake:

  • Your device: "Hi, can we talk?" (SYN)
  • The server: "Yes, I hear you. Can you hear me?" (SYN-ACK)
  • Your device: "Yes." (ACK)

From then on, every packet is numbered. The receiver confirms what it got, and anything missing is simply sent again. That's how a page arrives complete, even over a messy network.

4. HTTPS and the padlock

There's a problem, though. On its way, your request will pass through many machines owned by many different organisations. In principle, anyone along the path could read it, or change it.

That's what the "s" in https is for: secure. HTTPS is the web's usual language (HTTP) wrapped in a layer of encryption called TLS. It works in two steps:

  1. The site proves who it is. The server shows your browser a certificate, a kind of digital ID card. That certificate is signed by a certificate authority that your browser already trusts. So your browser can check it's really talking to example.com, and not an impostor pretending to be it.
  2. The two sides agree on a secret key. Using some clever maths, they each work out the same fresh secret key without ever sending the key itself. From then on, everything is scrambled. Someone listening in sees only noise.

That's the little padlock in your address bar. One important detail: the padlock does not mean the website is good, honest or safe. It means the connection is private. Nobody in between can read or change what you send. A scam site can have a padlock too.

5. Hop by hop: how your request crosses the internet

Now the request sets off. It goes over Wi-Fi to your router, then down the line to your internet provider.

And here's the surprising part: no single company runs the internet. It's made of tens of thousands of separate networks, run by internet providers, universities, cloud companies and big tech firms. They have agreed to carry each other's traffic. They often meet at buildings called internet exchange points, and they constantly tell each other which addresses they can reach, using a protocol called BGP.

Each router along the way does something very simple. It looks at the destination address on the packet, picks the next step, and passes the packet on. No router knows the whole route. Each one just knows: closer is that way.

A typical trip takes roughly 10 to 20 hops. If one link breaks, packets simply find another way around. Different packets from the same page may even take different paths.

6. Why you're often talking to a copy nearby

Distance still matters. Light in optical fibre travels at about two-thirds of its speed in a vacuum, roughly 200,000 km per second. That's fast, but a round trip from Europe to America and back still takes something like a tenth of a second. And loading a page needs many of those trips.

So big websites use a shortcut: content delivery networks (CDNs). They keep copies of their pages, photos and videos in servers all over the world, in cities close to their visitors. When you ask for the pancake page, you're often not talking to the original server at all. You're talking to a copy that might be just a few kilometres away.

When there's no copy nearby, your packets really do dive under the sea, through the submarine cables that connect the continents.

7. The request: GET, cookies and status codes

At last, your request reaches a server: a computer in a data centre somewhere.

The request itself is surprisingly simple. Inside the encrypted connection, it basically says:

  • GET /pancakes
  • Browser: (which browser you use)
  • Language: English
  • Cookie: (the little note you gave me last time)

That note is a cookie, a small piece of text a website asks your browser to keep and send back. Cookies are how a site remembers that you're logged in or what's in your basket. They can also be used to track you across visits.

The server sends back a reply that starts with a status code, a number that says how things went:

  • 200 OK: here's the page.
  • 301 Moved: it lives somewhere else now; the browser follows automatically.
  • 404 Not Found: the server has never heard of that page.
  • 500 Server Error: something broke on the server's side.

8. How your browser builds the page

That first reply isn't the page you see yet. It's a set of instructions written in HTML: put a heading here, a picture there, a list of ingredients below.

As your browser reads it, it discovers it needs more files:

  • CSS style sheets, for the colours, fonts and layout;
  • JavaScript, which makes the page interactive;
  • images, icons and fonts.

So it sends more requests, many at the same time. A typical page today needs dozens of files, sometimes more than a hundred, often from several different servers.

Meanwhile, the browser is already building:

  1. It turns the HTML into a structure of boxes (the DOM).
  2. It applies the styles.
  3. It works out where each box goes and how big it is (layout).
  4. It paints the pixels onto your screen.

It doesn't wait for everything to arrive before it starts drawing. That's why pages sometimes appear in pieces: the text first, then the pictures popping in.

9. Why some pages feel slow

When a page feels slow, it's usually not because your connection can't carry enough data. It's because of waiting.

Every DNS lookup, every handshake and every request is a trip there and back, and each one adds a little delay. Multiply that by dozens of files, and a fraction of a second becomes a few seconds. Engineers call that delay latency, and it matters more than raw bandwidth for most web pages.

That's why so much engineering goes into cutting down the trips:

  • Remembering answers (DNS and browser caches).
  • Keeping connections open instead of starting over for every file.
  • Sending several files at once over the same connection (HTTP/2).
  • Combining the handshake and the encryption into fewer steps (HTTP/3, which runs over a protocol called QUIC).

It's also why a server on the other side of the world will always feel a little slower than one in your own city. You can buy more bandwidth. You can't make light go faster.

Back to the click

So, back to that pancake recipe.

In the time it took to tap, your device:

  • looked up a name;
  • found a number;
  • shook hands with a stranger;
  • checked its ID and agreed on a secret;
  • sent its request hopping from network to network, maybe across an ocean, often to a copy of the page close by;
  • pulled in dozens of files and painted them onto your screen.

All in about a second. And it happens every time anyone taps a link, billions of times a day, all around the world.

Frequently asked questions

What is DNS in simple terms? DNS is the internet's phone book. It translates names that people can remember, like example.com, into the numeric IP addresses computers use to find each other.

Does the padlock mean a website is safe? No. The padlock means your connection to that site is encrypted, so nobody in between can read or change it. It says nothing about whether the site itself is trustworthy. Scam sites can have padlocks too.

What's the difference between HTTP and HTTPS? HTTPS is HTTP sent through an encrypted, authenticated connection (TLS). The site has to prove its identity with a certificate, and everything you exchange is scrambled for anyone watching the network.

Why does a web page load in pieces? Your browser starts drawing as soon as it has the HTML, while it is still downloading styles, scripts and images. Text often appears first and photos pop in as they arrive.

Is a faster internet plan always going to make pages load faster? Not always. For most web pages, the delay comes from the many round trips (latency), not from how much data your connection can carry (bandwidth). Being closer to the server, or to a CDN copy of it, often helps more.

This article goes with our animated explainer. Watch the video and subscribe for the next one: what happens when you press play on a video, and how it streams to you without stopping.

Related videos: How Wi-Fi Actually Works · The Cables Under the Sea · Inside a Data Centre · How GPS Actually Works