How to Extract URLs from Text
To extract URLs from text, paste the text and read the list on the right. The tool scans the whole text for anything that starts with http://, https://, ftp:// or www. and lists each link on its own line. This is the Example text and its result:
Input:
Docs: https://example.com/docs?page=2.
See also (https://en.wikipedia.org/wiki/Test_(disambiguation)) and www.example.org/news,
or <a href="https://example.com/docs?page=2">this link</a>.
Output:
https://example.com/docs?page=2
https://en.wikipedia.org/wiki/Test_(disambiguation)
www.example.org/newsFour links were found. The first and the last are the same, so the list has three. Notice what was left out: the full stop after the first link, the comma after the third, and the brackets around the second.
How Trailing Punctuation Is Handled
Links are usually written inside sentences, so the character after a link is often punctuation that is not part of it. The tool removes a full stop, comma, colon, semicolon, question mark or exclamation mark from the end of a link. Quotes and angle brackets end a link, which makes links in HTML attributes and in email text like <https://example.com> come out clean.
Round, square and curly brackets are treated with more care. A closing bracket is removed only when it has no opening bracket inside the link. That is why the link ending in (disambiguation) keeps its brackets, while a link written as (see https://example.com/page) loses the final bracket. Markdown links such as [text](https://example.com/a) also come out right.
List the Domains Instead of the Links
Set List to Domains only to get just the host name of each link, each listed once. This is useful when you want to know which sites a document or a log refers to. Domains with counts adds how many links point to each domain. With the Example text:
example.com (2)
en.wikipedia.org (1)
example.org (1)Remove www from domains is on by default, so www.example.com and example.com are counted together. Turn it off to keep them apart. Domain names are written in lowercase. A domain with non-Latin letters is shown in the form the browser uses for it, which can be the ASCII version that starts with xn--.
Remove Duplicates, Sort and Cut Query Strings
- Remove duplicates: lists each full link once, keeping the first position. Two links are the same only if they are written exactly the same, so https://example.com/a and https://example.com/a/ are two links.
- Order: As found keeps the order of the text. A to Z sorts the list alphabetically.
- Keep ? and # parts: turn it off to cut each link before the question mark or the hash sign. Links that differ only in their tracking parameters then become the same link, and duplicates are removed after the cut.
- Include www. links: turn it off if you only want links that start with a scheme such as https://.
For a longer list with more control over case and spaces, send the result to Remove Duplicate Lines. If a link contains percent codes such as %20, URL Decode shows the readable form.
Extract Links from HTML, Logs and Emails
The tool does not need to understand the document. It looks for the link itself, so it works the same for HTML source, Markdown, JSON, log lines, CSV and plain text. Links inside href and src attributes are found because the closing quote ends the link.
If your text has line breaks in the middle of links, because an email client wrapped them, remove the breaks first with Remove Line Breaks, using Nothing as the replacement, and then extract.
What This Tool Does Not Find
- Bare domains without www. or a scheme, such as example.com on its own. They look the same as file names and ordinary words, so they are not guessed.
- Email addresses and mailto: links. This tool is for web links only.
- Links whose host has no dot, such as http://intranet/page. localhost and addresses in brackets are the exceptions.
- Links that the page builds with scripts. The tool reads only the text you paste. It never opens or checks a link.
Input is limited to 2,000,000 characters. Your text is processed by code running in your browser. It is not sent to a server and not stored. See the Privacy Policy for details.