URL Extractor

Pull all URLs out of any text. Choose to include or exclude http(s) protocol.

Getting every link out of a block of text

This tool scans text or HTML source and pulls out every URL it contains, removing duplicates and sorting the results. It saves a great deal of manual copying when auditing a page, checking a document's references, or cleaning up an export.

Key takeaways

  • Matches http and https URLs, with query strings and fragments preserved.
  • Results are deduplicated and sorted.
  • Trailing punctuation is a common source of malformed matches.
  • Extraction is not validation - a well-formed URL may still be dead.
  • Everything runs locally in your browser.

What gets matched

The pattern looks for a scheme, followed by a host, followed by an optional path, query and fragment:

https?:\/\/[^\s"'<>)]+
InputExtractedNote
https://example.comhttps://example.comStandard
http://a.com/path?q=1#topFull URL with query and fragmentQuery strings preserved
<a href="https://x.com">https://x.comWorks on raw HTML
See https://example.com.https://example.comTrailing full stop trimmed
www.example.comNot matchedNo scheme
ftp://files.example.comNot matchedOnly http and https
Trailing punctuation is the classic extraction bug. In the sentence "Visit https://example.com." the full stop is not part of the URL, but a naive pattern grabs it. Parentheses cause the same problem - a URL inside brackets often ends up with a stray closing bracket attached. This tool drops sentence punctuation from the end of each link, and a closing bracket unless the link itself opened one (as in Wikipedia addresses such as /wiki/Foo_(bar)). A link that genuinely ends in a full stop is rare, but it would lose it, so check those by hand.

Anatomy of a URL

Understanding the parts helps when you need to filter or clean the results:

PartExampleWhat it is
SchemehttpsThe protocol used
SubdomainblogAn optional prefix on the host
DomainexampleThe registered name
TLD.comThe top-level domain
Port:8080Optional; defaults to 80 or 443
Path/articles/2026/postLocation of the resource
Query string?utm_source=news&id=5Parameters after the question mark
Fragment#section-2An in-page anchor, never sent to the server

Common uses

  • Auditing outbound links on a page before publishing.
  • Collecting references from a research document.
  • Extracting links from an email or chat export to check them.
  • Building a list of URLs to submit to a crawler or link checker.
  • Finding tracking parameters across a set of campaign links.
  • Migration work, where you need every URL referenced in old content.

Cleaning tracking parameters

Extracted URLs frequently carry campaign parameters that are irrelevant to the destination. The common ones are worth recognizing:

ParameterAdded bySafe to strip?
utm_source, utm_medium, utm_campaignGoogle Analytics taggingYes, for reference purposes
fbclidFacebook click trackingYes
gclidGoogle Ads click trackingYes
ref, referrerVarious referral schemesUsually
?id=, ?page=Application parametersNo - often required

Strip tracking parameters when storing URLs for reference, but be careful: some applications use query parameters that genuinely identify the page. Removing those breaks the link.

The UTM builder is the corresponding tool for constructing tagged links properly in the first place.

Extraction is not validation

  • A well-formed URL can be completely dead. The pattern checks shape, not existence.
  • Links rot steadily. A meaningful proportion of links in any document more than a few years old will have broken.
  • Redirects hide the real destination. Shortened links in particular reveal nothing about where they lead.
  • Never open an extracted URL blindly if the source text was untrusted - check the domain first.
Everything happens in your browser. Your text is processed entirely on your own device using JavaScript. Nothing is uploaded, stored or logged, which means you can safely paste confidential drafts, client work or personal notes. Closing the tab discards everything.

Frequently Asked Questions

How does the URL extractor work?

It scans your text with a regular expression matching http and https URLs, capturing the scheme, host, path, query string and fragment. Matches are then deduplicated and sorted alphabetically.

Does it extract URLs from HTML?

Yes. It works on raw HTML source as well as plain text, so pasting a page's source will pull out the URLs from href and src attributes along with any written in the visible text.

Why do some extracted URLs have a stray full stop or bracket?

Punctuation immediately after a URL is ambiguous - a pattern cannot always tell whether a trailing dot belongs to the URL or ends the sentence. This tool removes trailing full stops, commas, colons, semicolons, quote marks and unmatched closing brackets, which is right for links written in prose. Other extractors may not, so check the last character of links from them.

Will it find URLs without http or https?

No. Bare hostnames such as www.example.com are not matched, because requiring a scheme avoids enormous numbers of false positives from ordinary text containing dots. Add the scheme first if you need those included.

Does it check whether the links work?

No. It extracts URLs based on their shape only. A perfectly well-formed URL can point to a page that no longer exists. Use a dedicated link checker to test whether they actually resolve.

Should I remove tracking parameters from extracted URLs?

Usually yes when storing links for reference - utm_source, fbclid and gclid add nothing to the destination. Be careful with parameters like ?id= or ?page=, which often identify the actual content and cannot be removed without breaking the link.

Is it safe to open extracted URLs?

Only if you trust the source. Check the domain before clicking anything extracted from untrusted text, and be especially wary of shortened links, which reveal nothing about their destination until you follow them.

Is my text uploaded anywhere?

No. Extraction runs entirely in your browser and nothing is transmitted or stored. Closing the tab discards everything.

Related Calculators