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.

Try:
0Words
0Characters
0No spaces
0Sentences
0Paragraphs
0Lines
0Pages
0Reading
0Speaking

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

  1. Paste the text or HTML into the box.
  2. Press Extract URLs.
  3. Optionally press Sort A→Z to group links by domain.
  4. 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:

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 textExtracted
<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/statushttp://192.168.0.1:8080/status
www.example.comnot matched
ftp://files.example.comnot 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

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

PDF to textPulls the text out of a PDF without uploading the file anywhere.Remove HTML tagsTurns HTML into plain readable text, dropping scripts, styles and markup.Extract phone numbersFinds phone numbers in any text and lists them, one per line.Extract numbersPulls every number out of a block of text, and can total them for you.Random numberOne number, or a whole set without repeats, in any range you choose.Coin flipHeads or tails in one tap, with a running tally.Title case vs sentence caseThree style guides, three different answers, and the four-letter rule that…

See all text tools →

Frequently asked questions

Does it find links without http or https?

No. Bare domains like example.com are skipped because they cannot be reliably told apart from filenames, abbreviations and sentence punctuation.

Are duplicate links removed?

Yes, automatically. Each unique URL appears once no matter how many times it occurs in the source.

Can I paste HTML source?

Yes. Links inside href and src attributes are matched, so raw page source works without any cleanup.

Are query strings and anchors kept?

Yes. Everything up to the first space or closing quote is kept, including parameters after ? and fragments after #.

What about ftp or mailto links?

They are not matched. This tool looks only for http and https; use the email extractor for mailto addresses.

Can I sort the extracted links?

Yes, press Sort A→Z after extracting to group them by scheme and domain.

Is the text sent to a server?

No. Extraction happens entirely in your browser and nothing leaves your device.