Finding links in text: what counts as a URL
How the URL extractor finds every link in pasted text, HTML or chat exports, trims sentence punctuation, keeps brackets that belong to the link, and lists domains.
Last reviewed · 1,238 words
In short
- Links starting with http://, https://, ftp:// or www. are found anywhere in the text, including inside HTML href attributes.
- A full stop, comma or closing bracket at the end of a sentence is trimmed off, but a bracket the link itself opened is kept, as in Wikipedia's Sholay_(film).
- Duplicates are removed by default. The sample on the page has 5 links of which 4 are different, from 3 domains.
- Bare names like calci.in/tools without www. or http are not treated as links, so file names and version numbers are not caught.
- Nothing is uploaded. The text is searched in this browser tab.
A WhatsApp group export full of shared links, an email thread, a page of HTML, notes from a meeting: copying every link out by hand means scrolling, selecting and checking, and missing a few. The URL extractor reads the whole text at once and lists every link, one per line, ready to copy or save. Here is what it counts as a link and how it handles the awkward cases.
How to extract URLs from text
- Paste the text into the box. It can be plain text, an email, a chat export, a CSV or HTML.
- Read the list on the right. Every link appears once, in the order it was found.
- Copy the list, or download it as a .txt file or a .csv file for Excel or Google Sheets.
Options: keep duplicates by unticking Remove duplicate links, sort A to Z, or tick List domains only to turn every link into its domain name.
What counts as a link
A link here is text that starts with one of:
- https:// or http://, the web addresses;
- ftp://, file-transfer addresses still used by some government and university servers;
- www., the start of a web address typed without the scheme, common in chats and print.
The link then runs until a space, a line break, a quote mark or an angle bracket, the characters that cannot appear inside a URL as written. So a link inside HTML, such as <a href="https://calci.in/image-tools/">, is found and stops at the closing quote.
Text without http or www is not treated as a link. "calci.in/tools" on its own could be a link, but "report.pdf", "v2.5" and "Mr.Sharma" have the same dot-in-the-middle shape, and an extractor that took them all would fill your list with junk. Add www. or https:// in the text if you need such a link caught.
Trimming sentence punctuation
Links are usually written inside sentences, and the sentence's punctuation touches the link: "see https://calci.in/tools/." The full stop belongs to the sentence, not the address. The extractor trims these characters off the end of a link: full stops, commas, semicolons, colons, question and exclamation marks, quotes and closing brackets.
A closing bracket is kept when the link itself opened one. Wikipedia uses brackets in page names, as in https://en.wikipedia.org/wiki/Sholay_(film). Written inside a sentence in brackets, "(https://en.wikipedia.org/wiki/Sholay_(film))." ends with "))." The extractor counts the brackets inside the link, keeps the one that closes "(film", and trims the full stop and the outer bracket.
HTML's escaped ampersand, &, is turned back into & so that copied links with several parameters work.
Reading the example
The page opens with a short note from a meeting. The extractor finds 5 links in it, 4 of them different, because the FD calculator link appears twice:
| Link found | Domain |
|---|---|
| https://calci.in/finance/fd-calculator/?amount=500000 | calci.in |
| www.example.gov.in/apply/form-12.pdf | example.gov.in |
| https://en.wikipedia.org/wiki/Sholay_(film) | en.wikipedia.org |
| https://calci.in/image-tools/ (from an HTML link) | calci.in |
With List domains only ticked, the four links become 3 domains: calci.in, example.gov.in and en.wikipedia.org. Domains are compared without "www." and without regard to capital letters, so www.Calci.in and calci.in count once.
Duplicates and sorting
Remove duplicate links is on by default, and it compares links exactly, including capitals in the path, because web servers can treat /Page and /page as different pages. The first occurrence is kept, in its original position.
Sort A to Z orders the list alphabetically, which groups links from the same site together. Leave it off to keep the order the links appeared in the text, which is often the order they were discussed.
Extracting links from a web page
This page does not fetch other websites. To get the links from a page:
- Open the page in a desktop browser and press Ctrl + U (Cmd + Option + U on a Mac) to view its source.
- Select all with Ctrl + A, copy, and paste here.
Relative links in the source, such as /about/, have no http or www, so they are not listed. Only full addresses are.
Exporting a WhatsApp chat
In WhatsApp, open the chat, tap the menu, choose More → Export chat → Without media, and save or share the .txt file. Open it, copy the text and paste it here. Every link shared in the chat is listed in seconds, with repeats removed.
Saving the list
Download .txt saves one link per line, the format most tools accept for bulk imports. Download .csv saves a one-column spreadsheet with a header, URL or Domain; a link containing a comma or a quote is quoted so the spreadsheet does not split it.
Common uses
- Collecting links shared in a group. Study groups, office teams and families share links all day; an exported chat turns into a clean list of every form, document and video in a few seconds.
- Checking a page's outgoing links. Paste a page's HTML source to see every full link it points to, for example before publishing, to make sure nothing points to a test site.
- Cleaning up notes. Meeting notes, research notes and bookmarks pasted from different places come out as one tidy list.
- Building a list for a broken-link check. Extract the links first, then open or test them one by one.
- Finding which sites a document cites. Tick List domains only to see at a glance which websites a report or an article relies on.
Links in PDFs and Word files
A PDF or Word document stores its links in a way that copying the text does not always carry over: copying gives you the visible words, and if the link was attached to words like "click here", the address itself is not in the copied text. When the address is written out in full in the document, copying the text and pasting it here works. For a document where links hide behind words, save it as HTML from Word, or open the PDF in a browser and copy from there, and paste the result.
Why some links in the list may not open
The extractor finds what is written. A link that was cut off when the text was typed or wrapped, one with a typing mistake, or one whose page has since been removed will still be listed. Links written across two lines in an email are a common case: the address stops at the line break, so only the first half is found. Join the line in the text and paste again.
Links with tracking codes
Links copied from social media, shopping sites and newsletters often carry tracking parameters after a question mark, such as ?utm_source=whatsapp or &fbclid=, which tell the site where the click came from. The extractor keeps links exactly as written, so two shares of the same article with different tracking codes count as two different links. To see them as one, tick List domains only, or remove everything after the ? in the saved list before comparing.
What this tool assumes
- Links start with http://, https://, ftp:// or www. and end at a space, line break, quote, angle bracket or another character that cannot appear in a written URL.
- Trailing sentence punctuation is trimmed; a closing bracket is kept when it closes a bracket opened inside the link.
&becomes&. Relative links and bare domain names without www. are not listed.- Duplicate links are compared exactly; domains are compared without www. and case.
- The text stays in your browser tab and is not uploaded.