Fragment identifier 2026-11-05
A fragment identifier is the component introduced by
# in a URL, supplying a reference within or associated with the identified resource. In https://example.org/manual.html#setup, setup is the fragment. Interpretation depends on the representation and its rules; an HTML element identifier is a familiar example, not the only possible meaning.[ref]Uniform Resource Identifier (URI): Generic Syntax. Section3.5: fragment semantics depend on media type
The Hypertext Transfer Protocol target excludes the fragment. A browser requesting the preceding example requests the document without
#setup, then can process the fragment locally. This differs from a query string, which can help identify the requested resource.[ref]HTTP Semantics. Section7.1: fragment excluded from target URI
For an illustrative comparison,
manual.html#setup and manual.html#examples can select different places in one retrieved document. Changing only the fragment therefore need not imply fetching two different document bodies. Conversely, a syntactically valid fragment does not prove that a matching destination exists in the current document. Percent-encoding 2026-11-05
Percent-encoding represents a byte using a percent sign followed by two hexadecimal digits. For example, byte value 32 is written
%20. Non-ASCII text is first encoded as bytes: in UTF-8, é becomes the two bytes hexadecimal C3 A9, represented as %C3%A9.[ref]Uniform Resource Identifier (URI): Generic Syntax. Section2.1: percent-encoded octets
A useful example distinguishes data from delimiters. The path in
https://example.org/a/b has two segments; the path in https://example.org/a%2Fb retains the encoded slash within one segment in the parsed URL record. A server may apply additional decoding, but the two spellings must not be assumed interchangeable at every processing stage.Percent-encoding is neither encryption nor a universal instruction to decode repeatedly. The string
%252F decodes once to the text %2F; a second decoding changes it again. Likewise, the plus sign is not universally a space: that convention belongs to form-style query string processing, including URLSearchParams, rather than all URL components.[ref]URL Standard by WHATWG. Section1.3; Section5: form-urlencoded processing
Query string 2026-11-05
A query string is the component following
? and preceding #, or the end, in a URL. It carries data whose interpretation is defined by the resource or application. The generic syntax does not require a dictionary of names and values.[ref]Uniform Resource Identifier (URI): Generic Syntax. Section3.4: query component
For example,
https://example.org/search?q=red&tag=a&tag=b#results has query q=red&tag=a&tag=b. An application using form-style conventions can interpret repeated tag entries as a list. URLSearchParams preserves repeated entries: getAll('tag') returns both a and b. Converting that list directly into a dictionary with one value per name can lose information.Encoding conventions also matter. Under URLSearchParams parsing,
q=a+b gives the value a b, while q=a%2Bb gives a+b. That distinction comes from the specified form parser, rather than a general law that every plus in every URL means a space.[ref]A useful test records both the original query string and the parsing convention. A changed spelling, changed list of values and changed server response are three different observations.
Relative URL reference 2026-11-05
A Relative URL reference identifies a target using a base URL to supply missing context. It can contain a path, a query string or a fragment identifier, without independently specifying an entire network address. Resolution combines the reference with the base according to a defined algorithm.[ref]
Uniform Resource Identifier (URI): Generic Syntax. Sections4.2 and5.2: relative references and resolution
Trailing slashes provide an illuminating comparison. Resolving
c against https://example.org/a/b gives https://example.org/a/c; resolving it against https://example.org/a/b/ gives https://example.org/a/b/c. In the first case the last base path segment is replaced, while in the second it names a directory-like prefix.A parent-directory step is similarly concrete:
../image.png against https://example.org/a/b/page.html gives https://example.org/a/image.png. These outcomes follow from URL processing, not from examining an actual filesystem. No network request is needed to calculate them.[ref] URL scheme 2026-11-05
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.[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.