Skip to content
ToolPlankDEV
Text Tools
100% In-Browser Execution

Updated:

URL Extractor: Extract URLs from Text

This URL extractor finds every link in pasted text, HTML or logs and lists them one per line. It removes duplicates, cleans trailing punctuation, and can list or count the domains instead. Nothing is uploaded.

Options:

Your text

Input
0 chars · 0 lines

Extracted links

Ready
Processing in browser...
0 chars · 0 linesUpdates as you type

Processed on your device. Your text is not sent to our servers.

More free tools you may need next.

Quick Guide

How to use URL Extractor

Simple step-by-step instructions to get the exact output you need.

  1. 01

    Paste your text

    Paste any text that contains links into the Your text box: an email, a document, a web page's source code, a log file or a chat export. You can also press Paste, drop a .txt or .html file onto the box, or press Example.

  2. 02

    Read the list

    The links appear on the right, one per line, in the order they were found. A link that starts with www. is included even if it has no http:// in front. Trailing punctuation such as a full stop after a link is removed.

  3. 03

    Choose what to list

    List can show full links, only the domains, or the domains with a count of how often each one appears. Remove duplicates, Keep ? and # parts and Order change the list further.

  4. 04

    Copy the result

    Press Copy to put the list on your clipboard, or Download to save it as a text file.

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:

Text
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/news

Four 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.

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:

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.

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.

Frequently Asked Questions

Technical Q&A for URL Extractor

Common questions about edge cases, character encoding, and privacy guarantees.

Paste the text into the box. Every link that starts with http://, https://, ftp:// or www. appears on the right, one per line. Press Copy to use the list.

Drop the .txt file onto the box or press Upload, and the tool reads it in your browser. The links appear on the right straight away.

Paste the HTML source. Links in href and src attributes are found, and a closing quote marks the end of each one.

Copy the cells from Excel and paste them into the box. Each link in each cell is listed, so you can copy the list back into a column.

Yes, by default. Each full link is listed once. Turn off Remove duplicates to list every occurrence.

Set List to Domains only. Choose Domains with counts to see how many links each domain has.

Yes, links that start with www. are included. A bare name such as example.com is not, because it cannot be told apart from an ordinary word or file name.

Links are often followed by a full stop, comma or bracket that belongs to the sentence. The tool removes those from the end of a link so that the result can be used as it is.

No. This tool lists web links only and does not collect email addresses.

No. The text is scanned in your browser and nothing is sent to a server or saved. The tool also never opens the links. Reloading the page clears the boxes.