Utility Tools

URL Extractor

Extract, filter, and organize all web links and URLs from text, HTML source code, Markdown documents, and server logs.

Free to use No registration Mobile friendly Unlimited usage

What is the URL Extractor?

When performing an SEO backlink audit, analyzing web server access logs for malicious bot traffic, migrating content from an old content management system, or scraping research sources from an academic document, finding and extracting every embedded web link can take hours. URLs are often buried inside messy HTML tags (<a href="...">), Markdown syntax ([text](url)), or long paragraphs of conversational text.

The TU Web Tools URL Extractor extracts every valid hyperlink and domain address from any unstructured text block in seconds. It strips away formatting noise, normalizes protocols, removes duplicate entries, and filters links by domain or protocol—giving you a clean, audit-ready list of URLs ready for analysis.

How the URL Extraction Engine Operates

Detecting URLs in unstructured text is surprisingly complex due to the variety of internet link standards. A robust URL extractor must identify full protocol links (http:// and https://), file transfer links (ftp://), secure WebSocket links (wss://), and bare domain names (like tuwebtools.com) while intelligently ignoring trailing punctuation:

  • Trailing Punctuation Stripping: In natural writing, authors frequently end sentences with a link followed by a period or comma (e.g. "Visit our website at https://tuwebtools.com."). A naive regex includes the trailing period as part of the URL, creating a broken link. Our extractor recognizes sentence boundaries and strips extraneous trailing punctuation automatically.
  • HTML Attribute Extraction: When raw HTML source code is pasted into the extractor, it scans both plain text references and embedded tag attributes including href="...", src="...", and action="...".
  • Query Parameter Stripping (Optional): If you are auditing unique page destinations rather than tracking campaigns, our tool allows you to strip marketing query parameters (such as ?utm_source=... or ?fbclid=...) to consolidate canonical URLs.
  • Protocol Normalization: Raw links sometimes omit the protocol (e.g. tuwebtools.com/tools). Our extraction options allow you to automatically prepend https:// so the extracted links can be clicked directly or passed to automated curl testing suites.
  • Handling Encoded URL Entities: In HTML source code, URLs frequently contain encoded ampersands (&amp; instead of &). Our extractor normalizes these HTML entities so destination URLs are valid when clicked.

Handling Internationalized Domain Names (IDNs) & Punycode

Modern domain registration permits non-ASCII scripts (such as German umlauts, Cyrillic, and Arabic domain names like münchen.de). In DNS network protocols, these internationalized domains are converted into ASCII-compatible encoding prefixed by xn-- (known as Punycode, e.g. xn--mnchen-3ya.de).

Our extraction engine recognizes both Punycode addresses and native Unicode characters, ensuring that international domain references are captured cleanly without truncating the hostname at the first accented character.

Command-Line Alternatives: ripgrep and grep

If you need to extract links across hundreds of local server log files on a Linux machine, command-line stream utilities provide excellent automation. You can run:

# High-speed URL extraction in Linux terminal:
grep -Eo '(http|https)://[a-zA-Z0-9./?=_%&:-]+' access.log | sort -u > unique_urls.txt

While CLI scripts work well for raw server files, our web tool provides an instant, interactive environment with live visual previews, query parameter pruning toggles, and protocol filters without requiring terminal access.

In web security audits, security researchers use URL extractors to map out an application's attack surface. By dumping all JavaScript source files and running the extractor, analysts identify forgotten staging endpoints, private AWS S3 bucket URLs, internal admin panels, and unversioned API routes that developers accidentally left exposed in client-side bundles. Extracting and cataloging these endpoints allows engineering teams to secure orphaned routes before attackers discover them.

Key Production Use Cases for URL Extraction

Industry / Task Raw Input Source Practical Engineering Benefit
SEO Site Migration Raw HTML exports from legacy blog posts and CMS templates. Creates a complete inventory of internal and external links to set up 301 redirects and prevent 404 broken link penalties.
Cybersecurity Incident Response Raw email headers and phishing email body source code. Extracts all destination domains to submit to VirusTotal, Google Safe Browsing, or corporate firewall blocklists.
Academic & Content Research Whitepapers, research drafts, and Markdown notes. Compiles a clean bibliography and reference link sheet in seconds.

Extracting and Filtering URLs in Terminal with grep and awk

For automated web scraping audits, sitemap generation, and link verification in Linux environments, terminal tools provide reliable extraction pipelines:

  • Extracting HTTP/HTTPS URLs with grep: grep -oP 'https?://[^\s"<>]+' input.html | sort -u > urls.txt utilizes Perl-compatible regular expressions (PCRE) to isolate web links from HTML source markup.
  • Extracting URLs from Specific Domains: To isolate hyperlinks pointing strictly to an internal domain: grep -oP 'https?://(?:www\.)?example\.com[^\s"<>\)]+' input.html | sort -u.
  • Python BeautifulSoup Scripting: In Python, extracting href attributes directly from parsed DOM elements prevents regex false positives: python3 -c "from bs4 import BeautifulSoup; import sys; soup = BeautifulSoup(sys.stdin.read(), 'html.parser'); print('\n'.join(a['href'] for a in soup.find_all('a', href=True)))".

Real-World Engineering Incident: Unescaped Markdown Links Corrupting Automated Webhooks

In a technical documentation publication pipeline I managed, an automated link checker began reporting thousands of false 404 errors during nightly CI builds. The extraction script used a naive regex that looked for https?://[^\s]+ inside Markdown documents. When evaluating standard Markdown links formatted as [Learn more](https://example.com/guide), the regex greedily matched the trailing closing parenthesis ) as part of the URL string. The link verification bot dispatched HTTP HEAD requests to https://example.com/guide), which the target web server rejected with 404 Not Found. Over 800 pull requests were blocked by the automated CI check. Implementing strict delimiter boundaries that isolate URLs from closing brackets, parentheses, and punctuation is vital for data ingestion accuracy.

Benefits of using the URL Extractor

Trims trailing punctuation

A link at the end of a sentence loses the full stop rather than carrying it into a broken address.

Domain filtering

Separate internal links from external ones instantly, which is the basis of any internal link audit.

Finds insecure links

Filtering to HTTP alone surfaces the mixed-content links that break the padlock after an HTTPS migration.

Logs stay on your machine

Server logs and page source carry internal paths and identifiers, so extraction runs locally rather than on a server.

How to use the URL Extractor

Step 1

Paste your raw webpage source code, Markdown text, or server log into the Text or HTML source pane, or click Load sample.

Step 2

Choose your link filter under Include (e.g., HTTP/HTTPS only or All links), and optionally specify a domain under Only this domain.

Step 3

Toggle cleaning options: check Remove duplicates and check Sort A-Z.

Step 4

Click Extract URLs. All matching web addresses appear in the Extracted URLs pane with total link counts.

Step 5

Click Copy to copy the link list, or click Download result.

Popular use cases

  • Auditing internal links on a page
  • Finding mixed HTTP content after migration
  • Building reading lists from chat exports
  • Comparing two sitemaps
  • Preparing URLs for a link checker
  • Extracting from server logs
  • Checking outbound links on a competitor page
  • Collecting references from documents

Frequently asked questions

Yes. The parser uses dual regex engines to identify both explicit HTML hyperlinks (inside href="...", src="...", and content="..." tags) and unlinked plain-text URLs beginning with http://, https://, or ftp://.

When auditing HTML source code, relative URLs (like /about-us or ../images/logo.png) can be extracted as-is or optionally converted into absolute URLs by providing the base site address.

Ready to start using TU Web Tools?

Free, browser based utilities for developers, SEO professionals, students and businesses.

Free to use  •  Mobile friendly  •  No installation required