A URL, or universal resource locator, is the location of an online resource.

URLs are sometimes called web addresses. Like street addresses, URLs are unique, and lead to specific online resources. These resources could be HTML or CSS files, API endpoints, and much more.

Here is the URL to freeCodeCamp's homepage: https://www.freecodecamp.org/

Tim Berners-Lee created the first specification for the URL in 1994. It built upon the existing domain name structure and added slashes (/) to separate directory and file names like computer file systems.

URLs are made up of several parts, and always include the scheme/protocol, domain name, and path to the file or resource. They may also include the port, parameters, and anchor:

image-107
mdn-url-all
Source: What is a URL?

The domain names of a URL can be broken down further into a subdomain, second-level domain, and top-level domain.

For example, the freeCodeCamp forum is located at https://forum.freecodecamp.org/.

In this URL, forum is the subdomain, freecodecamp is the second-level domain, and .org is the top-level domain.

The subdomain is a division of the whole domain, and is a bit like a room in a house. Similar to how a bedroom and bathroom serve totally different purposes, different websites or applications can exist on each subdomain. Common subdomains include www, blog, shop, and m for the mobile version of a site.

The second-level domain is the name of your website or resource, and is how people will find it online. Second-level domains are usually the names of people, companies, or organizations.

The top-level domain, or TLD, can give people some information about your company or organization. For example, .com is a generic TLD that can be used for everything from personal sites to online stores. Meanwhile, .org is meant for nonprofit organizations and communities.

These days there are many different TLDs like .dev, .tech, and .rocks.