Difference Between Absolute and Relative Path (With Table)

Online platforms are a rising forum for all businesses today. Pivotal to all such website on the World Wide Web are links or hyperlinks. These links that could be staged on a word or a symbol let us jump from one place to another on the internet. These links are of two types, Absolute and Relative, whose differences are based on the location path they describe and how.

Absolute vs Relative Path

The difference between an absolute and a relative path is that an absolute path specifies the location from the root directory whereas a relative path is related to the current directory.

Another visible difference between the two pathways is that an absolute pathway starts with a delimiting character such as “/” whereas a relative pathway never begins with such characters. In an absolute pathway the forward delimiting character then trickles down to the required location.

However, using a relative pathway is only feasible when moving around in the same directory. An absolute pathway is used when a link navigates to content in another website and a relative pathway is used while linking something on the same website.


 

Comparison Table Between Absolute and Relative Path

Parameter of ComparisonAbsolute PathRelative Path
By definitionspecifies the location from the root directoryrelated to the location from current directory
Function of delimiting characterBegins with a delimiting characterNever begins with a delimiting character
Navigates toContent from other domainsContent from the same domain
URL usedUses absolute URLUsed relative URL
Other namesFull-path or File pathNon-absolute path

 

What is Absolute Path?

An absolute path or a full-path is the pathway to a location in an operating system or over the internet. The specialty of this pathway is that it begins from the root directory and leads to the locations. A full-path always includes a detailed map to the location. These pathways are used to navigate from one website to another by hyperlinks that relate content on another domain.

For such navigations on domains of other website, an absolute path uses an absolute URL. These URLs are detailed and specific denoting to a particular location.

However, their delimiting characters differ depending on the operating system being used. Also there are several characters that are involved in the absolute path that carry different meaning in the computer language.

Such as a single “/” or “\” mean directory separator, a single dot “.” represents current directory and double dot or “..” represents the parent directory. 

Further these jargons change form from country to country such as a Korean or Japanese directory may use ¥ or ₩ as a directory separator instead of the standard “/” or “\”. An absolute path that always includes the root directory, most often than not, begins with “/” or “\” denoting the main file.

 

What is Relative Path?

A relative pathway is a set of information that leads to a location relative to the current directory. Such pathways use a relative URL to navigate among the links. A relative pathway can only be used to navigate within a particular domain and it does not allow jumping from one website to another when using a relative URL on the internet

These pathways are also a culmination of similar characters used by an absolute pathway. However, a relative pathway does not include the root directory and thus do not begin with the backslash or the forward slash. A relative path is also called a non-absolute path or a partial path. This type of pathways are particularly useful for web developers since they are short and take less time to write while typing lengthy codes for programmers.

Similarly, relative pathways are a part of the absolute pathway which denotes a certain location under the same directory when being used in operating systems such as Windows of Linux.

A relative pathway usually begins with”..” representing the parent directory and then trickles down to the specific location. However, they are much shorter than a full-pathway.


Main Differences Between Absolute and Relative Path

  1. The main difference between an absolute and a relative path is that an absolute path specifies the location from the root directory whereas relative path is related to the current directory.
  2. Another visible difference between the two pathways is that an absolute pathway starts with a delimiting character such as “/” whereas a relative pathway begins with characters such as “..” but never “/” or “\”.
  3. An absolute pathway is used when a link navigates to content in another website and a relative pathway is used while linking something on the same website.
  4. An absolute path is also called a full-pathway whereas a relative path is also called a non-absolute path or a partial pathway.
  5. An absolute pathway uses an absolute URL to navigate to pages that are beyond a single domain whereas a relative pathway uses a relative URL that navigates to pages only in the same domain

 

Conclusion

Both these pathways are used extensively by programmers to link and hyperlink pages within and out of websites. And thus they play a pivotal role in linking contents and webpage development.

However there are significant differences between the two pathways that make them very useful in separate ways.

The main difference between an absolute and relative pathway is that an absolute path specifies the location from the root directory and carries detailed information whereas relative path is related to the current directory and carries only a part of the absolute pathway.

Another key difference between the two pathways is that an absolute pathway starts with a delimiting character such as the directory separator “/” or “\” whereas a relative pathway begins with characters such as “..” but never “/” or “\”.

An absolute pathway is used to link content from another website and a relative pathway is used to link something on the same website. A relative pathway is a part of the absolute pathway and helps developers while writing lengthy codes for web pages.


References

  1. https://adl.engineering.osu.edu/sites/adl.osu.edu/files/uploads/J163_Inoue%20et%20al_JSV_2008.pdf
  2. https://psycnet.apa.org/record/1945-00905-001
x
2D vs 3D