Every part of a web address has a job, and the smallest part is the one most people scroll past: the short section after the # character at the very end. It is called the fragment, and once you can spot it, long URLs stop looking like one solid block of code and start reading like a labelled diagram.
The free URL Parser on Ovatly makes that easy, because it breaks any address into its components and shows the fragment as a named field of its own. This guide explains what the fragment is, where it sits, how it differs from the query string in front of it, and how to change one safely.
Contents
- Quick answer
- Where the fragment sits in an address
- The fragment and the query string are different fields
- What the fragment is for
- How to view and change a fragment, step by step
- Worked example: isolating #section
- Limitations and honest tradeoffs
- Common mistakes
- FAQs
- Conclusion
Quick answer
A URL fragment is the last part of a web address, starting with the # character, for example #section. It points at a section within the page rather than at a different page. In the URL Parser it appears as its own field in the breakdown, after the path and the query parameters, and you can change it in the editor and copy the rebuilt URL without disturbing the rest of the address.
Where the fragment sits in an address
A URL is read left to right in a fixed order: protocol, then the host, then the path, then the query parameters, and finally the fragment. The fragment is always last. If there is no # in the address, there is no fragment, and the breakdown simply has nothing to show in that field.
Because it sits at the end, the fragment is easy to miss when you skim, and easy to confuse with the parameters just before it. The parser removes that confusion by giving it a separate line. When you paste an address, you read the component breakdown, including the decoded path and the port that applies, and the fragment is listed on its own, exactly as written.
The fragment and the query string are different fields
The query string and the fragment sit next to each other, and they are routinely mistaken for one part. They are not. The query string is the part after the question mark, made of name and value pairs joined together, such as x=1&y=two. It carries values to the page: a search term, a page number, a tracking code.
The fragment carries no values in that sense. It names a place inside the page. In the breakdown, the parser lists parameters one by one in a table, and then lists the fragment separately. If you edit the parameters in the table, the fragment is untouched, and if you change the fragment in the editor, the parameters stay as they were. Two fields, two jobs.
What the fragment is for
In everyday terms, the fragment points at a section within the page, so a link can take a reader to the relevant heading instead of the top. That is its one modest job, and it explains why fragments appear so often in documentation, help pages and long articles shared between colleagues.
It also explains the fragment's limits. Changing the fragment does not change which page loads, because the page is decided by the parts before it: the protocol, host, port and path. A new fragment on the same address is the same destination, aimed at a different spot on the page.
How to view and change a fragment, step by step
- Paste the URL into the URL Parser. A bare domain works too, because https is assumed and the parser says so, though a bare domain has no fragment to read.
- Read the component breakdown and find the Fragment field. That is the part after the
#, shown on its own. - Scroll to the editor if you want to change it. You can also change the host, path or port there, and add, edit or remove query parameters in the table.
- Change the fragment to the section name you want, and leave every other field alone.
- Copy the rebuilt URL. Parameter values are re-encoded on rebuild, so a space becomes
+in the query string, and rebuilding normalizes the URL the way browsers do, for example adding a trailing slash to an empty path.
Worked example: isolating #section
Take the full address from the parser: https://user:[email protected]:8080/path/to/page?x=1&y=two#section
Its breakdown is: Protocol https:, Hostname example.com, Port 8080, Path /path/to/page, Parameters x = 1 and y = two, Fragment #section, Username user, Password pass.
The fragment is the final piece, #section, sitting after the two parameters. Now use the editor and change only that field, replacing section with another section name. Copy the rebuilt URL and every other part survives intact: the same protocol, the same host and port, the same path, and the same parameters x = 1 and y = two. Only the landing spot inside the page has moved. That small, controlled edit is exactly what the field separation is for.
Limitations and honest tradeoffs
The parser reads the address as text. It does not open the page, so it cannot confirm that the section a fragment names actually exists on that page. A fragment pointing at a missing section is still a well formed fragment; the reader simply lands without the jump.
The fragment is also only as meaningful as the page makes it. This guide claims nothing about how any particular site builds its sections, because the parser's model shows the address, not the page behind it. And a link with no # has no fragment at all, which is normal for most addresses you will paste.
Common mistakes
- Reading the fragment as another parameter. Parameters come before the
#and carry values in pairs. The fragment comes after and names a section. - Editing the whole URL by hand to change one section. One mistyped character elsewhere breaks the address. Change the fragment field in the editor and copy the rebuild.
- Expecting a new fragment to load a new page. The page is decided by the host and path. The fragment only moves the landing spot within it.
- Dropping the fragment when sharing a long page. Without it, your reader lands at the top and hunts for the section you meant.
- Assuming the parser verified the section exists. It reads text only. Nothing is fetched, so existence on the page is never checked.
FAQs
What is a URL fragment? The fragment is the last part of a URL, beginning with the # character. In https://example.com/page#section the fragment is #section. It points at a section within the page rather than at a different page.
Where does the fragment sit in a URL? It comes last, after the protocol, host, path and query parameters. In the parser breakdown it appears as its own field, separate from the parameters that precede it.
What is the difference between a fragment and a query string? The query string comes before the fragment and is made of name and value pairs, such as x = 1 and y = two. The fragment comes after the query and names a section in the page. They are separate fields in the breakdown.
Can I change the fragment without rebuilding the whole URL? Yes. Paste the URL into the parser, change the fragment in the editor, and copy the rebuilt URL. The host, path, port and parameters stay as they were.
Does the parser need to open the page to find the fragment? No. The parser only reads the text you paste, in your browser. The fragment is read from the address itself, and nothing is fetched or uploaded.
Conclusion
The fragment is a small field with a clear job: it names where inside a page a link should land, and it sits, always, after the # at the end of the address. The URL Parser shows it on its own line, separate from the query parameters, and lets you change it without risking the rest of the URL. For the security side of reading addresses this way, see our sibling guide on how to read a suspicious URL before you click it. For more guides in this series, see our URL and Link Tools guides.