How HTTP Works: Hypertext Transfer Protocol Explained

An MIT graduate who brings years of technical experience to articles on SEO, computers, and wireless networking.

Updated on June 23, 2021

Hypertext Transfer Protocol provides a network protocol standard that web browsers and servers use to communicate. You see HTTP when you visit a website because the protocol appears in the URL (for example, http://www.lifewire.com).

This protocol is similar to others, like file transfer protocol, in that it's used by a client program to request files from a remote server. In the case of HTTP, a web browser requests HTML files from a web server, which then display in the browser with text, images, hyperlinks, and related assets.

Because browsers communicate using HTTP, you can usually drop the protocol from a URL when you type it in the browser's address bar.

History of HTTP

Tim Berners-Lee created the initial HTTP standard in the early 1990s as part of his work in defining the original World Wide Web. Three primary versions were deployed during the 1990s:

The latest version, HTTP 2.0, became an approved standard in 2015. It maintains backward compatibility with HTTP 1.1 but offers additional performance enhancements.

While standard HTTP does not encrypt traffic sent over a network, the HTTPS standard adds encryption to HTTP through the use of Secure Sockets Layer or, later, Transport Layer Security.

How HTTP Works

HTTP is an application layer protocol built on top of TCP that uses a client-server communication model. HTTP clients and servers communicate through request and response messages. The three main HTTP message types are GET, POST, and HEAD.

An HTTP GET message.

The browser initiates communication with an HTTP server by initiating a TCP connection to the server. Web browsing sessions use server port 80 by default, although other ports such as 8080 are sometimes used instead.

After a session is established, you trigger the sending and receiving of HTTP messages by visiting the web page.

HTTP is what's called a stateless system. This means that, unlike other file transfer protocols such as FTP, the HTTP connection is dropped after the request completes. So, after your web browser sends the request and the server responds with the page, the connection closes.

Troubleshooting HTTP

Messages transmitted over HTTP may fail for several reasons:

When these failures occur, the protocol captures the cause of the failure and reports an error code to the browser called an HTTP status line/code. Errors begin with a certain number to indicate what kind of error it is.

For example, errors with a failure code beginning with a four indicate that the request for the page cannot be completed properly, or that the request contains the incorrect syntax. As an example, 404 errors mean that a web page cannot be found; some websites even offer fun custom 404 error pages.

Was this page helpful? Thanks for letting us know!

Get the Latest Tech News Delivered Every Day

Tell us why! Other Not enough details Hard to understand More from Lifewire

Internet protocols - illustration

List of TCP Ports and UDP Ports (Well-Known)

Photography showing arcing lines connecting urban skyscrapers in Tokyo, Japan

How to Use mRemoteNG to Manage Remote Connections

Ethernet - Cables and Switch

The Most Popular TCP and UDP Port Numbers

Virtual Data Center

Computer Networking Tutorial - Internet Protocol

FTP initials, file folder, globe

TCP Port Number 21 and How It Works With FTP

Screenshot of a website URL

What Is a URL (Uniform Resource Locator)?

Multiple Internet Browser Welcome Web Pages Milano, Italy - December 14, 2013: Multiple Internet Browser Welcome Web Pages on a lcd screen. Google Chrome, Safari and Firefox is included. The Operative System is Apple OSX.

20 Internet Terms for Beginners

Files being transferred <a href=from one location to another" width="360" height="240" />

What Is TFTP? (Trivial File Transfer Protocol)

What are the most popular routing protocols?

Top 5 Network Routing Protocols Explained

A family using various internet-connected devices all connected via Ethernet.

The Fundamentals of an Ethernet LAN, Explained

Young couple sitting on sofa in an apartment and using digital tablet and laptop together

Wireless Networking Protocols Explained

Eight swans flying in the sky

The Use of Octets in Computers and Networking

Datacenter networking.

What Is TCP/IP?

Image of a shared folder

How to Fix It When the Specified Network Name Is No Longer Available

HTTPS encryption on port 443

What Is Port 443?

Laptop and two connected balls, 3D Rendering

What Is PASV FTP (Passive FTP)? Tech for Humans

Hit Refresh on Your Tech News

Lifewire is part of the Dotdash Meredith publishing family. Newsletter Sign Up Newsletter Sign Up Newsletter Sign Up Newsletter Sign Up Newsletter Sign Up

We Care About Your Privacy

We and our 100 partners store and/or access information on a device, such as unique IDs in cookies to process personal data. You may accept or manage your choices by clicking below, including your right to object where legitimate interest is used, or at any time in the privacy policy page. These choices will be signaled to our partners and will not affect browsing data.

We and our partners process data to provide:

Store and/or access information on a device. Use limited data to select advertising. Create profiles for personalised advertising. Use profiles to select personalised advertising. Create profiles to personalise content. Use profiles to select personalised content. Measure advertising performance. Measure content performance. Understand audiences through statistics or combinations of data from different sources. Develop and improve services. Use limited data to select content. List of Partners (vendors)