URL Extractor From Text – Harvest Every Link in One Pass
Links rarely arrive in a tidy column. They hide inside email bodies, chat exports, scraped HTML, server logs, research notes, sitemaps pasted as plain text and half-finished documentation. Finding them by eye is slow and unreliable, because addresses wrap across lines, sit inside href attributes, repeat with different casing and trail off into sentence punctuation. This URL extractor scans the whole block in one pass and hands back a clean, de-duplicated, sortable list of web addresses along with a structural breakdown of each one.
Anatomy of a URL
Every result is split into its parts so you can audit and filter them. In https://shop.example.com:8443/cart/checkout?item=42#step2 the scheme is https, the subdomain is shop, the registrable domain is example.com, the public suffix is com, the port is 8443, the path is /cart/checkout, the query carries item=42 and the fragment is step2. Multi-level suffixes are handled too, so news.bbc.co.uk reports a root domain of bbc.co.uk rather than co.uk.
Six ways to match a link
Strict URLs only accept strings that already carry a scheme — http://, https://, ftp://, file:// — which is the safest mode because it never guesses. Include bare domains also matches scheme-less hosts such as www.example.com. HTML attributes reads href, src, srcset, data-src, action and poster values out of markup. Markdown links pulls destinations from [text](url), reference definitions and autolinks, keeping the anchor text. Special schemes collects mailto:, tel:, sms:, magnet: and file: targets, promoting bare email addresses to mailto:. All patterns runs every matcher at once for the widest net.
example.io from script.js. Filenames such as app.config.json and version strings like v1.2.3 are rejected, and every near miss is listed in the Rejected view with the reason, so nothing disappears silently.Cleaning the list before you use it
Extraction is only half the job. Normalisation lowercases the host, drops the default ports :80 and :443, collapses duplicate slashes and removes a trailing slash, so three spellings of the same page collapse into one entry. Separate switches strip the fragment after #, the whole query string after ?, or just the tracking parameters — utm_source, utm_medium, fbclid, gclid, mc_eid and igshid — which is the fastest way to turn a pile of campaign links back into canonical page addresses. Relative paths like /about and protocol-relative links like //cdn.example.com/lib.js become absolute as soon as you supply a base URL.
Filtering, sorting and formats
Include and exclude domain filters accept wildcards, so *.gov.uk keeps every government sub-domain while doubleclick.net drops an ad network; exclude is applied first, so it always wins. A scheme filter narrows the list to http, https or to mailto, tel when you are scraping a contact block. Results can be ordered by original position, alphabetically, by domain, by length or by how often each link appeared. The list then leaves in whatever shape the next system expects: a plain or numbered list, comma separated for a spreadsheet cell, JSON objects with the parsed parts, CSV rows, Markdown links, HTML anchors carrying rel="noopener noreferrer", or a domain summary with per-host counts and HTTPS ratios.
http:// results are badged as insecure, and javascript:, data: and vbscript: URLs are only extracted when you opt in — they are never rendered as clickable anchors. Treat every link from an untrusted document, especially a suspected phishing email, as hostile until you have checked the destination domain yourself.Auditing at a glance
Above the results sit counts for total matches, unique URLs, duplicates removed, unique domains, secure versus insecure links, rejected candidates and the longest address found. The domain view ranks hosts by link count with a share bar and an HTTPS ratio, which is exactly what an SEO outbound-link audit or a security review of a log dump needs. The highlighted source preview marks each match in place, so you can see what the matcher did and did not catch. Because the text may be a private email or an internal log, everything runs locally in your browser: nothing you paste, drop or extract ever leaves the page.