Text fragment link builder

Link to an exact sentence on any page with #:~:text=. Paste the passage, get a link that scrolls to it and highlights it — no anchor needed on the page.

Linking to a sentence, not a page

A text fragment is a piece of URL that tells the browser to scroll to a specific passage and highlight it — even when the page has no anchor there. It looks like this:

https://example.com/article#:~:text=the%20exact%20sentence

Everything after :~: is a fragment directive. The browser strips it before the page sees the URL, which is why a text fragment can sit alongside an ordinary #anchor without breaking it.

Why hand-written fragments so often fail

The grammar is prefix-,start,end,-suffix, so the comma and the hyphen are structural characters. If your passage contains a hyphen — "well-known", a date range, an em dash rendered as two hyphens — an unencoded one turns the first part of your text into a prefix, and the fragment matches something else or nothing at all.

This tool percent-encodes - as %2D, , as %2C and & as %26 in every part. Open the "what got encoded" panel above to see it happen.

Prefix, start, end, suffix

  • Start — the text to highlight. This is the only required part.
  • End — turns the link into a range: everything from the start text to the end text is highlighted. Use it for anything longer than a sentence, because a range survives edits to the middle of the passage while a full quote does not.
  • Prefix and suffix — words immediately before and after the match, used only to disambiguate. They are not highlighted. Reach for these when the phrase you want appears several times on the page.

Browser support and its limits

Text fragments work in Chrome, Edge, Safari and other Chromium browsers. Firefox supports scrolling to them behind a flag. A browser that does not understand the directive simply ignores it and loads the page normally — so the link is never broken, it just does not jump.

Two real limitations: the match cannot span a block boundary, so a passage crossing a paragraph break will not be found; and the text has to exist in the page's HTML, so a page that renders its content later may not be matched at all.

What it is good for

Citing a specific claim in a long document, sending a colleague the one clause in a contract that matters, quoting a paragraph in a bug report so the reader lands exactly where you did. Anywhere "it's about two thirds of the way down" is the alternative.

Occasional email

New tools, when there are new tools

No more than once a month, no tracking pixels in the mail, one-click unsubscribe.