Extract URLs From Text
Turn a wall of notes, a newsletter, or a page of raw HTML into a tidy list of links. The extractor repairs the classic capture mistakes — the full stop that belonged to the sentence, the closing bracket that never was part of the path — and can strip utm_ campaign baggage so what you save is the page, not the click that led you there. Nothing pasted here is stored; it is extracted and discarded per request.
Use this without the search next time. Prathom Workbench puts Prathom's tools in your toolbar.
Add to Chrome — freeWhat it does
- Finds http and https links, plus bare www. links in prose
- Balances parentheses so wiki-style paths survive intact
- Optional stripping of utm_*, fbclid, gclid and similar tracking parameters
- Deduplication, sorting, and a unique-domain count
How to use Extract URLs
- 1
Paste the source text
Prose, meeting notes, an email, or view-source HTML all work — links are recognized inside surrounding text, quotes, and attributes.
- 2
Decide about bare www. links
Text written by humans is full of links like www.example.org with no http in front. Keep the option on to catch them, or turn it off when you want strictly well-formed URLs.
- 3
Optionally strip tracking parameters
With the option on, query parameters that identify the click — the utm_ family, fbclid, gclid and friends — are removed while real parameters like a product size or a page number are kept.
- 4
Copy or download the list
The result is one URL per line, ready for a spreadsheet, a link-checking run, or a bookmarks import.
How it works
Two patterns run over the text: one for links with an explicit http or https scheme, and — when the option is on — one for bare www. links appearing in prose. Both capture greedily up to whitespace, a quote, or an angle bracket, which deliberately over-captures.
The interesting work is the repair pass. Written language wraps links in its own punctuation: a full stop because the link ended a sentence, a comma because it sat in a list, a paren because it was an aside. The repair loop peels these off the end one at a time — but a closing parenthesis is only removed while the URL holds more closers than openers. That single counting rule is what lets a wiki path ending in (v2) keep its paren while the sentence's own bracket falls away.
Stripping tracking parameters uses the standard URL parser (the same one browsers use) rather than string surgery: the link is parsed, the offending parameters deleted, and the URL reassembled. Links that cannot be parsed — the schemeless www. kind — are passed through untouched rather than run through a normalizer they never came from.
What counts as a tracking parameter
The utm_ family is an open convention, so it is matched by prefix — any parameter beginning utm_ goes. The rest is a fixed list of click identifiers attached by major platforms: fbclid, gclid, gbraid, wbraid, msclkid, twclid, yclid, mailchimp's mc_cid and mc_eid, and a few more. The bar for the list is strict: a parameter is only included when removing it cannot change the page the server returns. Anything ambiguous stays, because a link that stops working is a far worse outcome than one that still carries a tag.
When you'd use this
Collecting every source cited across a week of meeting notes. Auditing which domains a newsletter actually points to before forwarding it. De-noising share links before saving them somewhere permanent. Building the input file for a link checker from a page's HTML. Counting how many distinct domains a document leans on — the unique-domain stat answers that at a glance.
The visible text is not the destination
Extracting URLs from HTML finds the addresses in the markup, and those are the addresses that will actually be requested — which is not always what the page shows a reader.
A link can display one thing and go somewhere else entirely. <a href="http://elsewhere.example">bank.example.com</a> reads as a bank and leads
anywhere. That mismatch is the mechanism behind most phishing, and it is
invisible to anyone reading the rendered page rather than the source.
This is the main reason to extract from HTML rather than from copied text. The list you get is the set of places the document points, stated plainly, with the display text removed. Reviewing it takes a fraction of the time that hovering over every link does, and it catches the ones nobody hovers over.
Two things to look for. Domains that resemble a familiar one but are not it — character substitutions, an extra word, an unexpected suffix. And redirect or tracking wrappers, where the real destination sits in a query parameter; the URL decoder will show you what is inside.
Extraction is not a safety check. It tells you where the links go, and deciding whether that is acceptable is still yours.
Where a URL ends is a guess
There is no unambiguous rule for the end of a URL in running prose, so any extractor has to make a judgment, and two cases go wrong regularly.
Trailing punctuation is the common one. A sentence ending "see https://example.com/page." contains a full stop that is not part of the address — but a full stop is perfectly legal in a URL, so nothing in the character itself says which it is. Closing brackets and quotation marks have the same problem, and a URL that genuinely contains a bracket, as many wiki addresses do, is indistinguishable from one followed by a parenthesis.
The other case is a URL broken across lines. Text from a PDF or a hard-wrapped email splits long addresses at the margin, and the second half arrives as a separate line. What is extracted is the first fragment, which looks like a complete and valid URL and leads nowhere useful.
Both are visible if you look. Scan the extracted list for entries ending in punctuation and for entries that look truncated, and repair the source text before extracting rather than fixing the output. For hard-wrapped sources, run the text through the line-break tool first.
Examples
Sentence punctuation versus path punctuation
Two different closing marks, two different fates. The paren after (v2) is part of the path and stays; the one after it closed the sentence's bracket and is peeled off, as is the final full stop. Counting opening against closing parens inside the URL is what makes both calls correct at once.
Same page, minus the campaign baggage
The two utm_ parameters existed to tell the shop which newsletter you clicked; size=m is a real parameter that changes what the page shows, so it survives. The bare www link is caught too, and its trailing full stop — sentence punctuation again — is removed.
Frequently asked questions
How does the tool decide where a URL ends?
It cannot know for certain — the URL standard allows characters like full stops, commas, and parentheses, so "the URL ends at punctuation" would be wrong, and "punctuation belongs to the URL" is wrong just as often. The approach here is to capture generously and then repair: trailing sentence punctuation is peeled away, and closing brackets are removed only when the URL contains no matching opener for them.
Why does it find links that do not start with http?
Because people write them constantly. A newsletter that says "visit www.example.org for details" contains a working link in every reader's mind, even though technically it is not a URL at all without a scheme. The option is separate so you can switch it off when feeding a system that requires strictly absolute URLs.
What gets removed when I strip tracking parameters?
Anything starting with utm_, plus a fixed list of known click identifiers: fbclid, gclid, msclkid, mc_cid and similar. These encode where your click came from, not what the page contains, so the trimmed link opens the identical document. Functional parameters — searches, page numbers, product options — are never touched, because they change what the server returns.
Does the tool check whether the links still work?
No, and by design it never issues a request to any of them. Checking would mean contacting every extracted domain from your browser, which is slow, leaks your list to those servers, and can trip rate limits. This tool's job ends at producing the list; feed it to a dedicated link checker if you need liveness verified.
Can I paste raw HTML into it?
Yes. Quotes and angle brackets act as hard delimiters, so URLs inside href="..." attributes come out clean without the markup around them. That makes view-source the quickest way to get every link from a page you are reading — copy it all, paste it here, and skip writing a scraper for what is fundamentally a one-off job.
Further reading
- How to Extract Email Addresses From TextPulling addresses out of a thread or an export is a five-second job with the right tool and a surprisingly deep rabbit hole if you try to do it properly with a regular expression. The specification for what counts as a valid address is much stranger than anyone expects.
- What Makes a Good URL SlugMost slug advice is about length and hyphens, which are the easy parts. The decisions that actually cost something later are what to do with accented characters, whether to include a date, and the fact that a slug is effectively permanent the moment anyone links to it.
- Why item10 Sorts Before item2Sort a list of files and item10 lands before item2. This is not a bug and it is not a bad sort — it is the correct result of comparing text as text. Natural sort is the fix, and knowing when not to use it matters as much as knowing how.