Developer Tools
Text Fragment URL Generator
Generate URLs that scroll to specific text on a page and highlight it. Supports ranges, prefix and suffix context, and multiple highlights per link.
Build your link
Paste the page URL, then add the text you want highlighted when the link is opened.
Must start with http:// or https://. Any existing hash is replaced.
Load a sample
Fragment 1 of 1
The browser scrolls to and highlights from this text.
Highlights everything from Start text through End text.
Text that appears right before the highlight target.
Text that appears right after the highlight target.
Generated link
How to use
- Paste the URL of the page you want to deep-link into. Any existing #hash is replaced with the text fragment directive.
- Type the phrase you want highlighted into Start text. The browser needs at least a few unique words to find a stable match.
- Optionally add End text to highlight a range from Start text through End text, or Prefix and Suffix context to disambiguate when the same phrase appears more than once on the page.
- Click Add another text fragment to highlight more than one passage in a single URL. All highlights are applied when the link is opened.
- Click Open in new tab to verify the highlight in your browser, then copy the URL, the HTML anchor, or the Markdown link from the output panel.
About this tool
Text Fragment URL Generator builds W3C Text Fragment URLs, the standardized 'scroll-to-text' links that browsers added with the #:~:text=... directive. The output is a regular URL with a special fragment that tells the browser to jump to a specific phrase on the destination page and highlight it on arrival. Because the fragment is everything after the # in the URL, it never leaves the user's browser and is never sent to the server, which makes these links safe to paste into chat, support tickets, runbooks, code review comments, internal documentation, knowledge bases, and email replies. The encoder follows the spec exactly. The three structural delimiters inside the directive (the literal '-', '&', and ',') are percent-encoded to %2D, %26, and %2C inside the user's text so they cannot be confused with the prefix and suffix markers, the directive separator, or the boundary between fragments. Other characters that would otherwise survive a naive encodeURIComponent pass (the open and close parentheses, the apostrophe, the exclamation mark, and the asterisk) are also escaped so the URL pastes cleanly into messaging apps, CMSs, and document editors that sometimes break on literal punctuation. Spaces are emitted as %20, which is what every text fragment implementation expects. The tool supports the three common patterns: a single Start text value to highlight a phrase, a Start text and an End text value that highlights everything in between (useful for multi-line code blocks, paragraph ranges, and long quotations), and optional Prefix and Suffix context to disambiguate when the same Start text appears more than once on the page. Several fragments can be combined in one URL: each fragment is concatenated with '&text=...' and every match is highlighted simultaneously when the link is opened. The base URL is parsed with the browser's native URL constructor so http, https, query strings, paths, and existing fragments are all handled correctly; any existing #fragment on the input URL is dropped before the directive is appended. A live preview shows the full URL, the directive on its own, an HTML anchor snippet, and a Markdown link, each with its own copy button. An 'Open in new tab' control opens the link so you can verify the highlight in a supporting browser. Text fragments work in Chrome and Edge 80+, Opera 67+, and Safari 16.4+; older browsers ignore the directive and load the page normally, so the link is always a safe drop-in for any URL. Everything runs locally in your browser; the URL, the highlight text, and the context strings never leave your device.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
URL Encoder Decoder
Encode and decode percent-encoded URLs.
Open tool
DeveloperURL Parser
Break a URL into protocol, host, path, query params, and fragment with decoded values.
Open tool
DeveloperURL Cleaner
Remove tracking parameters from one URL or a batch of URLs at once.
Open tool
GeneratorYouTube Timestamp Link Generator
Build watch, share, embed, and markdown YouTube links that jump to a chosen start time.
Open tool
GeneratorMailto Link Generator
Compose a mailto link with cc, bcc, subject, body, and copy-ready HTML and Markdown snippets.
Open tool
SEOHTML Headings Extractor
Extract h1-h6 from any HTML, view the outline, and check for skipped or empty headings.
Open tool