Extract URLs from text
Pulls every http and https link out of text or HTML and removes duplicates.
This tool will extract URLs from text, HTML source, logs or anything else you paste in. Press the button and the box is replaced with a clean list of links, one per line, with duplicates already removed. Nothing is installed and nothing is uploaded.
Runs entirely in your browser. Your text is never uploaded — open DevTools, Network tab, and you will see zero requests while you use this tool.
How to use it
- Paste the text or HTML into the box.
- Press Extract URLs.
- Optionally press Sort A→Z to group links by domain.
- Press Copy, or Download .txt to save the list.
What this tool does
The text is scanned for anything starting with http:// or https:// and running until whitespace or one of the characters that normally ends a link in prose or markup: <, >, a double quote, a single quote or a closing bracket. Every match is collected and duplicates are removed, so a page that links to the same URL five times yields one line.
Query strings and fragments are kept intact, because they are usually the part you need — https://example.com/p?utm_source=news&id=7#top comes through whole. Links inside HTML attributes are matched, so you can paste raw page source without cleaning it first.
Bare domains are not matched. Text like example.com or www.example.com with no scheme in front is skipped, and that is on purpose. Without http:// there is nothing reliable to distinguish a domain from ordinary punctuation: Node.js, file.txt, etc.So at the end of a sentence, version numbers and abbreviations all look exactly like domains to a pattern matcher. A rule loose enough to catch example.com also catches dozens of things that are not links, and a list you have to clean by hand is worse than no list. The scheme is the one unambiguous signal, so that is what is used.
Examples
Input:
Read the guide at https://example.com/guide and the notes at https://example.com/notes?ref=2. Mirror: https://example.com/guide. Our site is example.com.
Output:
- https://example.com/guide
- https://example.com/notes?ref=2
The repeated guide link appears once, and the bare example.com at the end is not picked up.
What happens with different inputs:
| In the text | Extracted |
|---|---|
| <a href="https://example.com/a">link</a> | https://example.com/a |
| (see https://example.com/b) | https://example.com/b |
| http://192.168.0.1:8080/status | http://192.168.0.1:8080/status |
| www.example.com | not matched |
| ftp://files.example.com | not matched |
If you need bare domains, add https:// in front of them before extracting, or use Find and Replace in a text editor to do it in bulk.
When you need it
- Collecting every outbound link from a page you are auditing for SEO.
- Getting a list of sources out of a research document or a set of notes.
- Pulling URLs out of a server log or an error report to feed into a checker.
- Building a redirect map from a spreadsheet that was pasted as plain text.
- Extracting the links from a newsletter or an email export so you can archive them.
- Grabbing every image or asset URL out of raw HTML before a site migration.
Sorting A→Z after extraction groups links by scheme and domain, which makes it easy to see how many point at one particular site — useful when you are checking a page for excessive links to a single destination.
If you need email addresses instead, the email extractor is listed under Related tools below.
Doing it without this tool
Notepad++: tick Regular expression in Find, search https?://[^\s"'<>)]+, then Search, Mark All and Copy Marked Text.
Command line: grep -Eo "https?://[^\"'<> ]+" page.html | sort -u is the classic one-liner and handles very large files comfortably.
Excel: paste the text into a column, then use =IF(ISNUMBER(SEARCH("http",A1)),A1,"") to flag rows containing a link, filter out the blanks and run Data, Remove Duplicates. It only works if each link is already on its own row.
Google Sheets: =REGEXEXTRACT(A1,"https?://[^\s]+") pulls the first link from a cell.
Word: Find and Replace with wildcards can do it, but Word’s wildcard syntax is limited and links containing question marks or brackets tend to break the pattern.
Browser console: on a live page, [...new Set([...document.links].map(a=>a.href))].join("\n") gives every link the browser itself recognises.
Privacy: your text never leaves your browser
The pattern matching runs in JavaScript on your device. Nothing is uploaded, no request is made when you press the button, and no copy of the input or the result is stored.
That is useful when the text you are pasting is not just links — server logs, internal documents and email exports usually contain far more than the URLs you are after, and none of it should go to a third party just so you can get a list of links.
Related tools
Frequently asked questions
No. Bare domains like example.com are skipped because they cannot be reliably told apart from filenames, abbreviations and sentence punctuation.
Yes, automatically. Each unique URL appears once no matter how many times it occurs in the source.
Yes. Links inside href and src attributes are matched, so raw page source works without any cleanup.
Yes. Everything up to the first space or closing quote is kept, including parameters after ? and fragments after #.
They are not matched. This tool looks only for http and https; use the email extractor for mailto addresses.
Yes, press Sort A→Z after extracting to group them by scheme and domain.
No. Extraction happens entirely in your browser and nothing leaves your device.