Free URL Extractor: Extract Links From Text and HTML

Paste text, HTML, Markdown or an email, or drop a file, and get every link as a clean list. Free and private.

Updated

Runs entirely in your browser. Nothing you paste or open is uploaded.

Extract links from a page you have open (console snippet and bookmarklet)

Console: open the page, open the developer console, paste this and press Enter. Every http and https link on the page is copied, without duplicates.

copy([...new Set([...document.links].map(a => a.href).filter(h => /^https?:/.test(h)))].join('\n'))

Bookmarklet: drag this button to your bookmarks bar, then click it on any page. A box with every link appears over the page. Press Escape to close it.

Extract links

How to Extract URLs From Text

  1. Paste your text or drop a file

    Paste anything that contains links: an article, a chat log, an email, a spreadsheet column, Markdown or raw HTML. Or drop a .txt, .html, .htm, .md, .csv, .eml or .json file onto the drop area. Files are read in your browser.

  2. Pick a mode, or leave it on Auto

    Auto spots HTML and reads the real link targets from the tags. Plain text scans the words for anything that looks like a web address. HTML reads a, area and (if you tick it) img tags, and resolves relative links against the base URL you enter.

  3. Set the filters

    Keep or drop bare domains such as example.com, remove duplicates, keep only http and https links, and include or exclude domains. The list and the counts update as you change each option.

  4. Choose an order

    Keep the order the links appear in the source, sort them A–Z, or group them by domain so every link from one site sits together.

  5. Copy or download the result

    Copy the list, or download it as a TXT file (one URL per line), a CSV file (url, domain and, for HTML, the anchor text) or a bookmarks.html file that any browser can import.

What Counts as a URL?

A URL (uniform resource locator) is an address with a scheme, such as https, followed by a host and an optional path, query and fragment. The WHATWG URL Standard, which browsers follow, defines exactly how a string is split into those parts. RFC 3986, the older IETF definition, uses the same parts under slightly different rules.

People rarely write full URLs in running text, though. They write www.example.com, or example.com/pricing, or paste a link at the end of a sentence followed by a full stop. A useful URL extractor has to decide which of those are links and where each one ends. These are the rules this one follows, borrowed in large part from the autolink rules in the GitHub Flavored Markdown specification, which solved the same problem for comments and issues.

What you pasteWhat you getWhy
See https://example.com/docs.https://example.com/docsA trailing full stop, comma, colon, semicolon, question mark or quote ends the sentence, not the link
https://en.wikipedia.org/wiki/Mercury_(planet)https://en.wikipedia.org/wiki/Mercury_(planet)Balanced parentheses stay part of the link
(read https://example.com/a)https://example.com/aAn unmatched closing parenthesis is dropped
[docs](https://example.com/x)https://example.com/xMarkdown brackets are never part of a link
www.example.com/abouthttps://www.example.com/aboutwww. addresses get https:// added
example.com/pricinghttps://example.com/pricingA bare domain counts if its ending is a real top-level domain and the option is on
notes.md, build.sh, v1.2.3NothingFile names and version numbers are not domains
[email protected]NothingEmail addresses are skipped; they are not web links
https://a.com,https://b.comTwo linksLinks pasted back to back are split at the second scheme
https:\/\/api.example.com\/v1https://api.example.com/v1Escaped slashes from JSON are unescaped first

What Do People Use a URL Extractor For?

Most people reach for a link extractor when a pile of text hides a handful of addresses they actually need. These are the cases we see most.

  • Research notes: you pasted sources into a document over a week. Paste the document here and get a clean list of every source, sorted by domain, for a bibliography or a reading session.
  • Newsletters and emails: a newsletter links to twelve articles behind “Read more” buttons. Drop the .eml file, tick “Only http and https”, exclude the sender’s tracking domain and you have the twelve article addresses.
  • Chat exports: a Slack or Discord export, or a WhatsApp chat saved as .txt, has links mixed into thousands of messages. The extractor finds them and removes the duplicates people shared twice.
  • SEO and site audits: paste a page’s HTML with the base URL set to that page, and get every internal and external link with its anchor text as CSV. Filter to your own domain for internal links, or exclude it to see outbound links.
  • Moving between tools: a list of bookmarks, a to-read backlog or a column of links in a spreadsheet can come out as a plain URL list, ready for another app’s import box.
  • Tab lists: a copied list of open tabs from a tab manager usually has titles and addresses mixed together. The extractor keeps just the addresses so you can reopen or save them.

Limits and Troubleshooting

  • A link I can see is missing: check the filters first. Bare domains, the domain include list and “Only http and https” all remove links. The stats line shows how many were filtered out.
  • A file name was taken for a website: bare-domain detection uses the list of real top-level domains, and some are also file extensions (.ai for Illustrator files, .cc for C++ files). Untick “Include bare domains”, or exclude that domain.
  • A real domain was missed: names ending in .md, .py, .sh, .pl, .ps, .rs or .so are skipped as bare domains because they are far more often file names. Put https:// or www. in front and they are found.
  • Relative links were skipped: enter the page’s address in the base URL box and they resolve.
  • Links from an email come out broken: drop the .eml file instead of pasting its source, so the quoted-printable decoding runs.
  • IPv6 and internationalised domains: addresses such as http://[::1]:8080/ work. Domains in other scripts are converted to their punycode form (xn--…) by the URL parser, which is the same address.
  • Very large inputs: files of 50MB and more work, but a large HTML file has to be parsed in one step and can pause the page for a few seconds. Only the first 500 links are shown in the list; every link is included in the copy and the downloads.

The extractor finds addresses, it doesn’t check them. A link can be well formed and still lead to a page that no longer exists.

Frequently Asked Questions

What is a URL extractor?

A URL extractor is a tool that finds every web address inside a block of text, HTML or a file and gives you them as a clean list. This one also removes duplicates, filters by domain and exports the list as TXT, CSV or bookmarks.

How do I extract links from text?

Paste the text into the box at the top of this page. Every URL is listed straight away, with trailing punctuation removed. Copy the list or download it.

Does it catch URLs without https?

Yes. Addresses starting with www. are found, and so are bare domains such as example.com/pricing when “Include bare domains” is ticked. Both get https:// added.

Can I extract links from only one domain?

Yes. Type the domain in “Only these domains” and every other link is filtered out. Subdomains count, so example.com also keeps blog.example.com. Use “Exclude domains” for the opposite.

How do I extract links from HTML?

Paste the HTML or drop the .html file and leave the mode on Auto or HTML. The extractor reads the href of every link, keeps the anchor text for the CSV, and resolves relative links if you enter a base URL.

How many URLs can it handle?

Hundreds of thousands. In our test, an 18MB text file with 400,000 links took about a third of a second to scan. The list on screen shows the first 500; copy and downloads include all of them.

Is my text uploaded anywhere?

No. The extraction runs in your browser and nothing is sent to a server or stored. The page works offline once it has loaded.

Why is a link cut off at a bracket or a full stop?

Because text around a link often ends with punctuation that isn’t part of it. The extractor drops trailing full stops, commas and quotes, and drops a closing parenthesis only when it has no matching opening one, so Wikipedia links such as Mercury_(planet) stay whole.

How do I get all links from a website page?

Open the page, open the developer console and run the snippet shown in the tool box, or use the bookmarklet. Both copy every link on the page, which you can paste here to filter and export.

Can I save the links to reopen later?

Download them as bookmarks.html and import that into your browser, or open them and save the tabs as a session in BelayTab, which restores the whole set in one click.

Related

Keep Your Tabs Safe, Too

BelayTab saves and snapshots your tabs automatically, in every browser. Free.