Copy Link to Highlight: Free Tool to Link to Any Text

Paste a page address and the words you want to point at. Get a link that opens the page scrolled to that text, highlighted. Free, no sign-up.

Updated

Runs entirely in your browser. Nothing you paste or open is uploaded.


Which Browsers Support Scroll to Text Fragment?

Opening a text fragment link works in every current major browser. The versions below are the first ones that scroll to and highlight the text, according to caniuse and MDN. Older browsers ignore the :~: part and open the page normally, so a text fragment link is always safe to share.

BrowserOpens text fragment links from::target-text styling fromNotes
ChromeVersion 80–81 (2020)Version 89caniuse lists 81; Chrome’s own announcement says 80. The first to ship.
EdgeVersion 83Version 89Same Chromium engine as Chrome.
OperaVersion 68Chromium-basedSame engine as Chrome.
Samsung InternetVersion 13.0Chromium-basedAndroid.
FirefoxVersion 131 (October 2024)Version 131caniuse notes Firefox still has open issues with some pages.
Safari (Mac and iOS)Version 16.1 (2022)Version 18.2Could open links two years before it could create them.

Text Fragment Syntax Reference

The full form of a text directive is #:~:text=[prefix-,]textStart[,textEnd][,-suffix]. Square brackets mark the optional parts. Commas separate the parts, a dash after the prefix or before the suffix marks them as context, and an ampersand separates several directives.

PartExampleWhat it does
:~:#:~:text=…The fragment directive delimiter. Anything after it is for the browser, not the page.
#fragment:~:#install:~:text=npmKeeps an ordinary anchor. Browsers without text fragments still jump to #install.
textStarttext=open%20sourceThe text to highlight. With nothing else, the first exact match is highlighted.
textStart,textEndtext=Chapter%201,the%20endHighlights from the first match of the start to the next match of the end after it.
prefix-,text=in-,ParisWords that must come just before the match. Only whitespace may sit between them.
,-suffixtext=Paris,-TexasWords that must come just after the match.
&text=text=one&text=twoSeveral passages in one link. Each gets its own highlight; the page scrolls to the first.
%2Dtext=well%2DknownA dash inside the text must be percent-encoded, or it reads as a prefix or suffix marker.
%2Ctext=red%2C%20greenA comma inside the text must be encoded, or it splits start and end.
%26text=salt%20%26%20pepperAn ampersand must be encoded, or it starts a new directive.
%20text=two%20wordsSpaces are encoded. Emoji and accented letters are encoded as UTF-8 bytes, e.g. 🦊 becomes %F0%9F%A6%8A.

The spec lets letters, digits and ! $ ’ ( ) * + . / : ; = ? @ _ ~ appear unencoded. This tool also encodes ( and ), because Markdown and many chat apps end a link at the first closing bracket.

Privacy and Security Rules for Text Fragments

Text fragments are designed so that a link can’t be used to find out what is on a page you can see but an attacker can’t, such as your inbox or a signed-in dashboard. The spec and browsers enforce several limits for this reason.

First, a user activation is needed. The browser only searches for the text on a navigation that follows a real user action, such as clicking a link or typing an address, not one started silently by a script. Second, text fragments only apply to the top-level page. A page can’t load another site in an iframe with a text fragment to test whether some words are there.

Third, when a link crosses from one site to another, the new page must be opened without a reference back to the page that opened it (noopener). That stops the opening page from watching whether the new page scrolled. This tool’s Test button opens your link that way. Fourth, the spec asks browsers to take the same time to search whether or not the text is found, so timing can’t leak the answer.

Finally, scripts on the page can’t read the directive. The :~: part is stripped from location.hash and from the URL the page sees. The document.fragmentDirective object exists only so a site can check that the browser supports the feature. Remember, though, that the full link, words included, is still visible to anyone you send it to and in your browser history, so don’t put private text in a link you share.

How This Tool Works and What Happens to Your Data

Everything happens in your browser. The page address and passage you type are turned into a link by JavaScript on this page. Nothing is sent to our server or anyone else’s, and the tool doesn’t fetch the target page, so it can’t see whether the text is really there. That’s what the Test button is for.

To build the link, the tool collapses runs of spaces and line breaks into single spaces, percent-encodes each part with the same rules as JavaScript’s encodeURIComponent, then also encodes dashes and brackets. It splits your address at # so an existing anchor is kept, and replaces any text directive already in the link unless you ask it to add to them.

In Auto mode, a passage longer than 80 characters becomes a range: the first few words become the start and the last few become the end. A passage that spans several paragraphs always becomes a range, with the start taken from the first paragraph and the end from the last, because a single term can’t cross a paragraph break. You can choose how many words to keep at each end.

The checker does the reverse. It splits a link at :~:, separates the directives at each &, splits each one at its commas, works out which part is the prefix, start, end or suffix, and decodes them so you can read them. It warns about characters that should have been encoded, broken % escapes and parts that don’t fit the syntax.

Frequently Asked Questions

What does “copy link to highlight” mean?

“Copy link to highlight” is a right-click menu item in Chrome, Edge and Firefox that copies a link to the page with the text you selected built into it. Whoever opens the link is scrolled to that text, and it’s highlighted. Safari has the same feature under the name “Copy Link with Highlight”.

Why don’t I see “Copy link to highlight” when I right-click?

You need to select some text first; the item only appears on a selection. It also needs Chrome 90 or later, Firefox 145 or later, or Safari 18.2 or later. If it’s missing or greyed out, paste the page address and text into this tool instead.

Does a link to a text fragment work in every browser?

It opens in every browser, and highlights in current Chrome, Edge, Opera, Samsung Internet, Firefox (131 and later) and Safari (16.1 and later). Browsers without support ignore the :~: part and open the page at the top, or at the #anchor if there is one.

What does #:~:text= mean in a URL?

It’s a text fragment. The :~: marks the start of instructions for the browser, and text= gives the words to find and highlight. The part after text= is percent-encoded, so %20 is a space and %2D is a dash.

How do I link to highlighted text on a phone?

In Chrome on Android, iPhone or iPad, select the text and use the option to share or copy a link to the highlight. In Safari on iPhone and iPad, select the text, tap and hold, and choose Copy Link with Highlight. This tool also works on a phone browser.

Can I highlight more than one passage with one link?

Yes. Add several text directives joined with &, like #:~:text=first&text=second. Each passage is highlighted and the page scrolls to the first one. Use Add another passage in the tool to build one.

How do I remove the highlight?

Click anywhere on the page or reload it without the part after #. In Chrome you can also right-click the highlight and choose Remove highlight. The highlight never changes the page for anyone else.

Can a website block text fragment links?

Yes, in Chromium browsers. A site can send the Document-Policy: force-load-at-top header, which stops the page from scrolling on load, including to a text fragment. The link still opens the page.

Can the website see which text I linked to?

Not directly. Browsers never send the part after # to the server when they load a page, and they hide the :~: part from the page’s own scripts. Anyone you share the link with can read the words in it, though, so keep private text out of it.

Why does my text fragment link highlight the wrong place?

The browser highlights the first match on the page. If the same words appear earlier, add a prefix or suffix, a few words just before or after your passage, so only the place you mean matches.

Related

Keep Your Tabs Safe, Too

BelayTab saves and snapshots your tabs automatically, in every browser. Free.