How Browsers Work

An interactive guide to the internal world of browsers.

Browsers work with URLs

You can type literally anything in the address bar. But under the hood, browsers work with URLs:

  • A random text like pizza will be transformed into a "search" URL like https://google.com/search?q=pizza (or https://duckduckgo.com/?q=pizza depending on your preferences).
  • A domain name like example.com will be normalized as a full URL: https://example.com

To see how this works in practice, type something in the address bar and press Enter (or click the "Go" button):

Try “pizza” or “example.com”.

Turning a URL into an HTTP request

Once we know the exact URL we want to visit, we can send a request to the server to fetch the resource and display it in the browser. Browsers communicate with servers using the HTTP protocol.

To see how a URL is translated into an HTTP request format, enter a full URL like https://example.com and press Enter (or click the "Go" button):

Enter a full URL like https://example.com.

HTTP requests have headers in the format like:

Host: example.com
Accept: text/html

One of the headers is the host header. It is used to identify the server to which the request is sent: example.com.

Resolving the server address

Browsers can't send requests to names like example.com.

Computers talk to IP addresses, so the browser first asks the DNS system to resolve the domain name into an IP address before it can connect to the server and send the HTTP request.

Type a domain name in the input and press Enter to resolve it into an IP address:

Terminal
$resolve

Next Section

A temporary section to prototype and write faster.

Example