Whats the difference between a scheme and a protocol in a URL?

My understanding is that the two terms have a significant overlap. The protocol being the agreed upon method of information transfer and the scheme being the identifier that URLs use to express what type of protocol the specific resource should be served over. In short, schemes are simply identifiers for protocols.

For example

In the link https://example.com, https is the scheme that tells the browser (or whoever the requester of that resource is) that the resource at example.com will be served over the Hypertext Transfer Protocol Secure (HTTPS), which is the type of "protocol".

Scheme <> Protocol

ftp <> File Transer protocol
http <> Hypertext Transfer Protocol
https <> Hypertext Transfer Protocol Secure

A scheme and protocol are not the same, so to answer your question, technically there isn't a protocol in the URL, only a scheme.

To know what the protocol is you need to inspect the request.

Consider your URL is (quoted from @clayjones94 answer):

https://example.com

And your HTTP request (snippet) starts with:

GET / HTTP/1.1
Host: example.com

...

https would be the scheme

HTTP/1.1 would be the protocol

The reason people mix the two or interchange them is because they are inferring the protocol based on the scheme, but you can't really do that because you could be using either the HTTP/1.1 or HTTP/2 protocol to send a request to https://example.com, which is using the https scheme.


A network protocol is a communication system of rules for transferring data. A scheme is a systematic plan for a data structure.

A URI does not contain a protocol but does contain a scheme [1]. A scheme can be associated with a protocol but does not have to. E.g. the http: scheme is associated with the HTTP/1.0 or 1.1 protocol [2] but the file: scheme is not associated with any protocol. Http is a scheme and a protocol whereas file is a scheme but not a protocol.

[1] https://en.wikipedia.org/wiki/Uniform_Resource_Identifier; 29/01/21

[2] https://www.w3.org/2001/tag/doc/SchemeProtocols.html#useNaturalProtocol; 29/01/21