What Happens When You Type a URL and Press Enter
Trace a page load step by step, from reading the address through DNS, connections, encryption and HTTP to the pixels on your screen.
Key takeaways
- The browser first decides whether you typed an address or a search, then splits a real address into scheme, host, path and other parts.
- DNS supplies the IP address, and caches at several levels mean the full lookup often doesn't happen.
- A secure page needs a transport connection and a TLS handshake before any HTTP request is sent.
- Rendering is a pipeline of its own, and scripts, stylesheets and images can add many more requests.
When you press Enter, your browser reads the address, finds the server's IP address, opens a connection to it, sets up encryption, sends an HTTP request and then turns the response into a page you can see and use. Along the way it checks several caches that can skip whole steps, and it usually repeats parts of the process for dozens of extra files.
All of this often finishes in about a second. Knowing the order is useful, because each stage fails in its own recognizable way and each one can make a page feel slow.
Step 1: the browser reads what you typed
The address bar does double duty. If your text looks like an address (it has a dot and no spaces, or starts with a scheme such as https://), the browser treats it as a URL. Otherwise it usually sends the text to your default search engine. As you type, it may also suggest history entries and bookmarks, and some browsers send partial input to a search provider for suggestions unless you turn that off.
A URL such as https://www.example.com:443/guides/start?lang=en#setup has distinct parts.
The default port is usually hidden. Spaces and some other characters get percent-encoded, which you can explore with the URL encoder and inspector. For a fuller tour, see the anatomy of a URL.
Step 2: shortcuts and safety checks
Before going to the network, the browser looks for reasons not to. A service worker installed by the site may answer from local storage, which is how some pages work offline. The HTTP cache may hold a copy that is still fresh according to the rules the server sent earlier.
The browser also applies security policy. If the site has told it to use only secure connections (a mechanism called HSTS) or the domain is on the browser's built-in preload list, a plain http address is upgraded to https before anything leaves your device. Many browsers also check the address against lists of known malicious sites.
Step 3: finding the IP address
If a connection is needed, the browser needs an address for the host. It checks its own DNS cache, then asks the operating system, which checks its cache and the local hosts file. If neither knows, the question goes to a recursive resolver.
A resolver that has no cached answer asks a root server where to find .com, asks the .com servers who is responsible for example.com, and then asks that authoritative server for the address. It remembers each answer for the record's time to live. You may get both IPv4 (A) and IPv6 (AAAA) answers, and browsers typically try them in a way that favors whichever connects quickly. The step-by-step version is in what happens during a DNS lookup.
Step 4: opening a connection
With an address in hand, the browser opens a transport connection. For HTTP/1.1 and HTTP/2 that means TCP: your device sends a SYN, the server answers with SYN-ACK and your device replies with ACK. That exchange costs one round trip before any data flows. See the three-way handshake.
For HTTP/3, the browser uses QUIC over UDP, which combines connection setup and encryption into fewer exchanges. A browser usually learns that a site supports it from an earlier response or a special DNS record.
Packets leaving your network pass through your router, which rewrites your private address to its public one and remembers the mapping so replies find their way back.
Step 5: the TLS handshake
For https, the two sides now agree on encryption keys. In TLS 1.3 the client sends supported options and key material in its first message. The server replies with its choice, its own key material and its certificate, plus proof that it holds the matching private key.
The browser checks that the certificate covers the host name, hasn't expired and chains up to an authority the device trusts. If a check fails, you get a full-page warning. Treat that seriously, especially on a site where you sign in or pay. After the handshake, everything is encrypted. The TLS handshake, step by step covers the messages in detail.
Step 6: the HTTP request and response
The browser now sends a request. In readable form it looks like this:
GET /guides/start?lang=en HTTP/1.1
Host: www.example.com
User-Agent: ExampleBrowser/1.0
Accept: text/html
Accept-Encoding: gzip, br It also attaches any cookies the site set earlier. The server may be a content delivery network node, a load balancer or an application server that queries a database before answering.
The response begins with a status code. 200 means success, 301 or 302 sends you elsewhere (and the process repeats for the new address), 404 means nothing is at that path and codes in the 500 range mean the server failed. Headers describe the content type, compression and caching rules. You can look up unfamiliar codes in the HTTP status reference.
Step 7: turning bytes into a page
The browser starts working as soon as the first part of the HTML arrives.
- It parses HTML into the DOM, a tree of the page's elements.
- It fetches stylesheets and builds the style rules that apply to each element.
- It runs scripts, which can change the tree. A script without
deferorasyncpauses parsing while it loads and runs. - It calculates layout, deciding the size and position of everything.
- It paints pixels and composites layers onto the screen.
Images, fonts and video arrive as their own requests, often from other hosts that need their own DNS lookups and handshakes. That is why a page can show text quickly and keep loading for a while. How a browser turns code into pixels goes further.
Step 8: after the page appears
The load isn't really over when you can see the page. Scripts keep running and may call the site's programming interfaces for fresh data, such as prices, comments or your unread count. Analytics and advertising code, where present, send their own requests, often to other companies' servers.
Browsers also keep connections open for reuse. The next click on the same site can skip DNS, TCP and TLS entirely and go straight to the HTTP request, which is why moving around within a site usually feels quicker than arriving.
Finally, the browser records what happened: an entry in your history, files in the cache and any cookies the responses set. A private browsing window discards most of that when you close it, but it doesn't hide your activity from the sites you visit or from the network carrying the traffic.
A worked example: why one page feels slow
Say a server is far enough away that each round trip takes 150 milliseconds, and nothing is cached. An uncached DNS lookup might add some time. The TCP handshake costs one round trip, or 150 ms. A TLS 1.3 handshake costs another. The request and the first bytes of the response cost a third, plus whatever the server spends building the page.
That is already close to half a second before any content appears, and the page may then discover a stylesheet on a second host that needs the same setup again. Faster internet service barely changes these figures, because the time goes into waiting for replies and not into moving volume. Serving the site from a nearby location, reusing connections and using HTTP/3 all attack the waiting directly.
Where the time goes, and what can go wrong
| Symptom | Likely stage |
|---|---|
| "Server not found" or a DNS error code | Name lookup |
| Long wait, then a connection timeout | TCP or QUIC connection |
| Certificate warning | TLS handshake |
| Error page with a 4xx or 5xx code | HTTP response |
| Blank or jumbled page that eventually settles | Rendering, stylesheets or scripts |
Your browser's developer tools show this directly. Open them, choose the network panel, reload the page and inspect a request's timing breakdown. You'll see separate entries for DNS, connecting, TLS, waiting for the first byte and downloading, though cached or reused connections skip some of them.
Distance matters a lot in the early stages. Each round trip to a faraway server adds delay that more bandwidth can't remove, which is why sites reuse connections, compress files and serve copies from nearby locations.
Common questions
Does the second visit go through all of this?
Usually less of it. The DNS answer may still be cached, TLS can resume a previous session, and many files come straight from the local cache.
Can my network see the full address?
With HTTPS, the path, query and page contents are encrypted. The server's IP address is visible, and the host name is often visible through DNS queries and the TLS handshake unless additional protections are in use.
Why does the fragment never reach the server?
The fragment after # is an instruction to the browser about where to scroll or which view to show. It is handled locally, although scripts on the page can read it.