What the link extractor does
This tool reads HTML, Markdown or plain text and lists every link in it. For HTML it shows the anchor text and the rel attribute of each link, so you can see at a glance which links are marked nofollow, sponsored or ugc. Relative links like /about become full URLs when you give the page's address. You can remove duplicates, sort the list, show only internal or external links, only one host, or only images or PDFs, and export the result as a .txt list or a .csv file with the URL, text, rel value and type of every link.
What it is good for
- SEO audits: list the outbound links of a page, check that paid links carry rel="sponsored", and count how many internal links point to each section.
- Site migrations: collect every URL in your templates, content exports or Markdown files before a move, so you can plan redirects. The guide on how to move a website to a new domain walks through the whole process.
- Link checks: paste the exported list into the broken link checker to find links that return errors.
- Content work: pull the sources out of a document, the images out of a template, or the downloads out of a page.
How the links are found
| Input | What is read |
|---|---|
| HTML | href of a and area elements, src and srcset of img and source elements, href of link elements, src of script elements; you choose which |
| Markdown | [text](url),  for images and reference definitions like [id]: url |
| Plain text | Addresses that start with http://, https://, ftp:// or www. |
HTML is parsed with the browser's DOMParser into a separate document that is never shown. MDN's page on parseFromString notes that scripts in such a document do not run. Auto mode treats the input as HTML when it contains common tags, and as Markdown and text otherwise.
Finding URLs in plain text needs a pattern. RFC 3986, section 2 allows letters, digits, - . _ ~, percent escapes and reserved characters such as : / ? # [ ] @ ! $ & ' ( ) * + , ; = in a URL. Many of those also end sentences or wrap text in brackets, so the tool uses a practical subset: a URL runs until a space, a quote, an angle bracket or a backtick. Then, following the autolink rules of GitHub Flavored Markdown, trailing ? ! . , : * _ ~ are dropped, a closing bracket is dropped when it has no opening partner in the URL, and an ending like & is dropped. Links written as www.example.com get http:// in front, as that spec does. Appendix C of RFC 3986 recommends angle brackets around URLs in text for exactly this reason, and URLs in <…> are found cleanly.
What the rel values mean
Google's guide to qualifying outbound links describes three rel values:
| rel | Use it for |
|---|---|
| sponsored | Links that are advertisements or paid placements |
| ugc | Links in user-generated content, such as comments and forum posts |
| nofollow | Other cases where you do not want Google to associate your site with the linked page, or crawl it from your site |
Several values can be combined, separated by spaces or commas, and the tool reads both. Other values, such as noopener, are listed as well.
Relative and absolute links
An absolute link has a scheme and a host, like https://example.com/about. A relative link, like /about, soil-guide or ../images/a.jpg, only makes sense next to the address of the page it is on. The tool resolves relative links with the URL API in your browser, which follows the URL Standard. With the base https://example.com/blog/post, /about becomes https://example.com/about and soil-guide becomes https://example.com/blog/soil-guide. If the HTML has a base element, its address is used. Without any base, relative links stay as written.
Internal and external are decided by host. Enter your domain, and links to it, to its subdomains and to its www. form count as internal. mailto: and tel: links are neither.
Privacy
Everything happens in your browser. Your text and files are not uploaded, and the tool never opens, loads or checks any of the links it finds. Copy link shares only the options, not the text, base URL or domain.
How to use the link extractor
- 1Paste HTML, Markdown or text, or open or drop a file.
- 2For HTML, tick which elements to read and enter the page's address as the base URL.
- 3Filter by internal or external, type or host, and pick the order.
- 4Copy the URLs, or download them as .txt or as .csv with text, rel and type.
Related tools: the email extractor pulls addresses out of text, HTML to text turns a page into readable text, and the XML sitemap generator turns a list of URLs into a sitemap.
Sources
- Google Search Central, Qualify your outbound links to Google: sponsored, ugc and nofollow
- RFC 3986, section 2, Characters and Appendix C, Delimiting a URI in Context
- GitHub Flavored Markdown Spec, Autolinks (extension): trailing punctuation and brackets
- WHATWG, URL Standard: resolving relative URLs
- MDN, DOMParser: parseFromString() method
Related guides
- Technical SEO Checklist for a New Website
- Robots.txt vs Noindex vs Canonical: Which One to Use
- HTTP Status Codes Cheat Sheet: 200, 301, 404, 500 and More
Frequently asked questions
Does the tool open or check the links?
No. It only reads the text you paste or the file you open, in your browser. It does not request any of the URLs, so it cannot tell whether a link works. To test links for errors, use the broken link checker.
Is my HTML uploaded or run?
No. The HTML is parsed with DOMParser into a separate document that is never added to this page. MDN notes that scripts in such a document are not run. The tool then reads the link attributes from that document. Copy link shares only your settings, never the text, the base URL or the domain.
Why are some links missing?
javascript: links and data: URLs are skipped and counted, because they do not point to another page. Links within the page, like #top, are skipped while Skip links within the page is on. In HTML, only the elements you tick are read, and links in plain text need http://, https://, ftp:// or www. to be found.
How are relative links like /about turned into full URLs?
Enter the address of the page the HTML came from as the base URL. The tool resolves each relative link against it with the URL API in your browser, as a browser does when you click the link. If the HTML has a base element, its address is used. Without a base, relative links are kept as written and counted as internal.
What do nofollow, sponsored and ugc mean?
They are rel values Google documents for outbound links: sponsored for ads and paid placements, ugc for user-generated content like comments and forum posts, and nofollow when you do not want Google to associate your site with the linked page or crawl it from your site. The table marks each link that has one.
Which counts as internal?
A link whose host is the domain you enter, a subdomain of it, or the same with www. in front. Without a domain, the host of the base URL is used. Relative links that could not be resolved are counted as internal, because they point to the same site.