URL scheme (source code)

= URL scheme
{c}

A <URL scheme> is the leading component before `:`, selecting a family of interpretation and processing rules. For example, `https` is the scheme of `https://example.org/a`. Scheme syntax begins with an <ASCII> letter and then permits letters, digits, plus, hyphen and period. Comparison is case-insensitive, and standard serialization uses lowercase.<Uniform Resource Identifier (URI): Generic Syntax>[Section3.1: scheme syntax and case]{ref}

The scheme does not imply that every <URL> names a remote server. Compare `https://example.org/a` with `data:text/plain,hello`: both have schemes, but the second example carries data in its own spelling rather than naming an HTTPS host. A <URL parser> must apply the appropriate rules rather than demand a host and port for every case.

The colon also separates a scheme from a familiar relative-path interpretation. The text `a:b` is parsed as a URL with scheme `a`, whereas `./a:b` can be a <Relative URL reference>. Adding the initial dot and slash therefore changes the syntactic role of the colon-containing text.

Scheme-specific defaults matter too: omitting port 443 when serializing an HTTPS URL reflects that scheme's default, not a rule that all numerical ports are redundant.<URL Standard by WHATWG>[URL scheme, special schemes and parsing/serialization]{ref}