Format Code Now
/

Extract URLs from Text

TX-24

Paste any text and get every http, https, ftp and www link back, one per line. Trailing punctuation such as a full stop or a closing bracket is trimmed.

Runs in your browser. Nothing is uploaded.

Text that contains links

URLs

How to use it

  1. Paste the text that contains links into the input box.
  2. Leave Remove duplicates ticked, and tick Sort A to Z for an ordered list.
  3. Tick Add https:// to www links if you want every link to start with a scheme.
  4. Press Extract URLs, then copy the list or download it as a .txt file.

What counts as a link

A link starts with http://, https://, ftp:// or www. and runs until a space, a double quote, an angle bracket or a backtick. Links with other schemes such as mailto: and file:, and bare domains such as example.com, are not found. Nothing is fetched or checked, so a link that returns a 404 is still listed.

How trailing punctuation is trimmed

Text around links often leaves marks stuck to the end. A trailing . , ; : ! ? … » or a quote mark is cut off, but underscores, asterisks and tildes are kept, so https://example.com/__init__ stays whole. A closing bracket is cut off only when the link has no opening bracket to match, so (https://example.org/a) loses its bracket while https://example.com/page_(v2) keeps it. The cost is that a real address that ends in a full stop loses it.

Error messages and what to do

MessageWhat it meansFix
No links starting with http://, https://, ftp:// or www. found in the text.The text has no link with a supported start.Check that links begin with http://, https://, ftp:// or www.

Questions people ask

How do I extract URLs from text?

Paste the text and press Extract URLs. Every http, https, ftp and www link is listed on its own line. Duplicates are removed by default.

Does it find links without http, like www.example.com?

Yes, links that start with www. are found. Tick Add https:// to www links to write them with a scheme. Bare domains with no www., such as example.com, are not detected.

What happens to a bracket or full stop after a link?

A full stop, comma or quote right after a link is trimmed. A closing bracket is trimmed only when it has no matching opening bracket inside the link, so links with brackets in the path stay whole.

Can it extract links from HTML?

It will find absolute links that appear as plain text in the markup, such as in href values, since it stops at a double quote. It does not parse HTML, so relative links such as /about are not listed.

Does it check if the links work?

No. It never opens the links, so it cannot tell whether a page exists or answers. It only reports text that looks like a link, exactly as it appears in your pasted text, apart from trimmed punctuation.

About this tool

A link is found when it starts with http://, https://, ftp:// or www. and runs until a space, double quote, angle bracket or backtick. Trailing . , ; : ! ? and quote marks are cut off, and a closing bracket is cut off only when it has no matching opening bracket in the link, so a Wikipedia style address ending in (v2) keeps its bracket. A real address that ends in a full stop would lose it. Links with other schemes such as mailto: or file:, and bare domains without www. such as example.com, are not found. Links are not checked or opened, and are not changed except for the optional https:// prefix.

Format Code Now: free, no ads, no accounts. Your input stays in your browser.