Field note

Understanding URL anatomy

A URL is an address and a compact description of how a resource should be reached.

A typical URL can contain a scheme, hostname, port, path, query string, and fragment. Not every address uses every part.

Scheme or protocol

The scheme appears before ://. For websites this is usually https. It tells software which protocol to use.

Hostname

The hostname identifies the server or service, such as example.com. Subdomains appear to the left of the registered domain.

Path

The path identifies a resource within the site. Paths are hierarchical and use forward slashes.

Query parameters

The query begins with ?. Parameters are commonly written as key-value pairs separated by &.

https://example.com/search?q=web&page=2

Fragment

The fragment begins with #. Browsers often use it to jump to a section within a page. It is not normally sent to the server in an HTTP request.

Use the URL Inspector to see each component in a live example.

Open the toolkit