HTML link extractor
Extract links from page source or rich-text HTML in bulk: five attributes are scanned (href, src, action, poster, data-src) with double-quoted, single-quoted and unquoted syntax. Give a base URL to resolve relative paths, ../ segments and protocol-relative URLs into absolute ones, then deduplicate, sort, keep http/https only and read the matched/unique/output/filtered counts.
Runs in your browserEvery computation happens in your browser — your data never leaves this device.
Links
One per line, in first-seen order; duplicates are dropped by default.
Paste HTML to see the extracted links and the counts
What this tool does
- Harvest every link from page source at once: paste the "view source" content and get a de-duplicated URL list.
- Turn relative paths into absolute URLs: supply the page address as the base and /docs/a.html, ../img/b.png and //cdn.example.com/x.js all come back as full URLs.
- Collect image or asset lists: keep only http/https to drop javascript:, mailto: and #anchors, which are counted instead of silently vanishing.
Example
Input
<a href="https://example.com/docs/start.html">Start</a> <img src="https://example.com/img/logo.png" alt="logo"> <a href="https://example.com/docs/start.html">Same link</a>
Output
https://example.com/docs/start.html https://example.com/img/logo.png
With the defaults (dedupe on, no sorting, no protocol filter): 3 attributes matched, 2 unique, 2 output, of which 2 are absolute URLs. The third href repeats the first and is dropped by deduplication.
Frequently asked questions
Which attributes are extracted?
href, src, action, poster and data-src (case-insensitive), in double-quoted, single-quoted or unquoted form. srcset, url(...) inside style attributes and links inside CSS files are not handled.
Why does it also pick up links inside comments?
This is an attribute-by-attribute scan rather than a full HTML parse, so an href="..." inside an HTML comment or a JavaScript string is matched too. The upside is speed and no DOM requirement; the downside is lines you may not want, which the dedupe option and your own filtering handle.
Are HTML entities such as & decoded?
No, attribute values are printed as they appear (https://example.com/x?a=1&b=2 stays as it is). Use a dedicated HTML entity decoder for that; this tool only picks links out.
What should the base URL look like?
It must be a full URL with a scheme, for example https://example.com/docs/page.html. Relative paths resolve against it, so /x lands in the domain root. An invalid base raises "the base URL is not valid" instead of silently emitting raw values.
What does "filtered out" mean in the counts?
It counts entries dropped by the onlyHttp option. With "keep http/https only" enabled, every value that does not end up starting with http:// or https:// is removed and counted there: mailto:, tel:, javascript:, #anchors and relative paths when no base URL is set.
Keywords:extract linkshref extractorabsolute url