Web Basics

What Happens When You Type a URL Into a Browser

By BoldlyWeb Editorial Team · · 5 min read

You type a web address, press Enter, and a page appears in well under a second. It feels instant, but a surprising amount of coordinated work happens in that moment. Your browser, your operating system, several servers and a few layers of the network all take part.

Understanding this chain helps when something breaks. A slow page, a certificate warning and a "site can't be reached" message each point to a different step. Here is the journey in order.

Step 1: The Browser Reads the Address

A URL has several parts. Take a typical address and split it up:

  • The scheme (such as https) tells the browser which protocol to use.
  • The host is the name of the server, like a domain name.
  • The port is optional. Secure web traffic normally uses 443 and plain web traffic uses 80, so you rarely see it.
  • The path points to a specific resource on that server.
  • The query string carries extra parameters after a question mark.
  • The fragment after a hash sign points to a spot inside the page. It never leaves your browser.

If you type only a word or phrase, the browser treats it as a search instead and sends it to your default search engine.

Step 2: Checking Local Caches

Before touching the network, the browser looks for shortcuts. It may already hold a saved copy of the page, or at least some of its files such as images and style sheets. It also checks whether the site is on a list of addresses that must always use HTTPS. If a fresh copy exists, the browser can skip several later steps.

Step 3: Turning a Name Into an Address

Computers locate each other with numeric IP addresses, not names. The Domain Name System (DNS) is the lookup service that translates one into the other.

The browser asks the operating system, which checks its own cache. If there is no answer, the request goes to a DNS resolver, usually run by your internet provider or a public service you configured. The resolver may ask a chain of servers: a root server, then the server for the top level domain, then the server responsible for that specific domain. The final answer is an IP address, and every layer remembers it for a while so the next lookup is quicker.

Step 4: Opening a Connection

With an IP address in hand, the browser opens a TCP connection to the server. This begins with a short exchange often called a handshake, where both sides agree they are ready to talk. Newer web protocols can use QUIC over UDP instead, which combines some of these steps and recovers better from lost packets, but the goal is the same: a reliable channel between two machines.

Step 5: Securing the Channel With TLS

For HTTPS sites, the browser and server then perform a TLS handshake. The server presents a certificate that proves its identity, signed by an authority your browser already trusts. The two sides agree on encryption settings and create shared keys. From this point, anyone watching the network sees scrambled data rather than the page contents.

If the certificate is expired, issued for a different name, or signed by an unknown authority, the browser stops and shows a warning. That warning is the system doing its job.

Step 6: Sending the HTTP Request

Now the browser sends an HTTP request. It names the method (usually GET), the path, and a set of headers that describe the browser, the languages you prefer, and any cookies stored for this site. A simplified request looks like this:

GET /articles/intro HTTP/1.1
Host: example
Accept: text/html

The server may be a single machine or a large group behind a load balancer. It runs application code, may query a database, and prepares a response.

Step 7: Receiving the Response

The response starts with a status code. A 200 means success, a 301 or 302 means "look somewhere else," a 404 means the resource was not found, and a 500 means the server failed. After the status come headers, such as the content type and caching instructions, and then the body, usually HTML.

Redirects are common. Many sites send you from the plain version to the secure one, or from one address form to another, and each redirect repeats part of this process.

Step 8: Building the Page

The browser parses the HTML into a tree called the DOM. While reading, it discovers more resources: style sheets, scripts, fonts and images. Each one triggers its own request, often over the connection that is already open.

  • CSS is parsed into rules that decide how elements look.
  • JavaScript may run and change the DOM, fetch more data or react to clicks.
  • The browser combines the DOM and styles to compute layout, then paints pixels to the screen.

Scripts and style sheets can block rendering, which is why heavy pages feel slow even when the network is fast.

Step 9: The Page Stays Alive

Loading is not the end. Scripts keep running, images arrive late, and the page may call servers in the background to refresh content. The browser also stores cacheable files so a return visit is faster.

Frequently Asked Questions

Why does the first visit to a site feel slower than later visits?

The first visit needs a fresh DNS lookup, a new connection, a full TLS handshake and downloads of every file. On later visits many of those results are cached, so the browser can reuse them and skip much of the work.

Does the browser send the part after the hash sign to the server?

No. The fragment stays inside the browser and is used only to jump to a section of the page or to pass state to scripts. The server never receives it as part of the request.

What does a "site can't be reached" error usually mean?

It usually means a failure before any page content arrived. Common causes are a DNS lookup that found nothing, a server that refused or timed out on the connection, or a local network problem. Checking another site helps tell you whether the issue is on your side or theirs.

Related reading

  • Browsers

    How Browser Cookies Work

    Learn what browser cookies are, how sites set and read them, the difference between session and persistent cookies, and how to control them.

    · 4 min read