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. New to topics? Read the docs here!