How to Extract All Links (href) from HTML Code
An href extractor is a paste tool, not a crawler. FlashKit’s link extractor reads href="/%E2%80%A6/" and href='/%E2%80%A6/' from the HTML you drop into Input HTML or Text, de-duplicates with a set (first-seen order), and prints one URL per line. It does not fetch the live page, does not run JavaScript, and does not upload the snippet. That is the right default for a navigation template, a newsletter HTML export, or a landing-page dump you already have on disk.
People who search “href extractor”, “hyperlink extractor”, or “free online link extractor” often want a crawl. This page is not that. For a proxied fetch of titles and robots tags, use the bulk metadata extractor. For a first-pass site crawl, use the free SEO audit. For hostnames only, see extract domains from a URL list.
Paste HTML, get every quoted href
Local regex, de-duplicated, Copy button. No crawl, no account. Sort internal vs external in your sheet after.
Open the href extractorWorked example
Paste this fragment:
<nav>
<a href="/blog/">Blog</a>
<a href="https://www.flashkit.tools/tool/href-links-extractor/">Extractor</a>
<a href="/blog/">Blog again</a>
<a href='https://example.com/guide'>Partner</a>
<img src="/hero.jpg" alt="">
</nav>
Click Extract Links. The list is three lines, not four:
/blog/— kept once (the second Blog link is a duplicate).https://www.flashkit.tools/tool/href-links-extractor/https://example.com/guide— single quotes are accepted.
/hero.jpg is not listed because it is src, not href. Unquoted href=/bare is also skipped. After you Copy, mark internal vs external yourself: /blog/ is site-relative (internal). The flashkit.tools URL is internal only if that is your host; example.com is external.
Step-by-step
- Copy HTML. In Chrome: right-click → View page source, or copy a component from your editor. Do not paste a URL into the box and expect a fetch — the placeholder says “Paste your HTML content here to find href links...”
- Open the href extractor and paste. Click Extract Links.
- Read Extracted Links (N). Copy the textarea. There is no file download and no sort control.
- In a spreadsheet, add a column for host. Internal = empty host (relative) or your own domain. External = everyone else. Then check 301s on the important rows with the HTTP requests checker.
Comparison: extractor vs audit vs metadata
| Job | Use | Network? |
|---|---|---|
| Inventory hrefs in HTML I already have | This extractor | No |
| Titles, descriptions, robots, canonical for many URLs | Bulk meta checker | Yes, CORS proxies after consent |
| Broken links and missing tags on a public site | Free SEO audit | Yes, proxied crawl |
| Unique hostnames from a URL dump | Domain extractor | No |
Tips
- mailto: and tel: they are hrefs, so they appear. Filter them in the sheet if you only want http(s).
- Hash links such as
#pricingare kept. They are not separate pages. - CMS templates often repeat the same nav 50 times. De-duplication is the feature, not a bug.
- Legal — extracting links from HTML you own or are hired to audit is fine. Do not use this to scrape directories you have no right to copy. Pair with meta tags for SEO when you move from link lists to on-page tags.
The extractor is a regex on quoted hrefs, not a DOM parser. Malformed HTML with missing quotes will under-count. If that happens, run the snippet through the HTML5 validator first, then extract again.
Email HTML, sitemaps, and “link extractor” mix-ups
Newsletter HTML is full of tracking hrefs: https://click.example.com/q/... wrapping every button. Extract, then sort by host. The click-wrapper host is external even when the visible label says “Read the blog.” That is useful before you rewrite a template, and it is not something a live crawl of the public site would show, because the email never was a public URL.
A sitemap.xml is not HTML. Pasting <loc> tags into this box will not list those URLs unless they also appear as href. For a URL list you already have, skip the extractor and go straight to the bulk metadata tool or the bulk URL opener (pop-up blockers apply). For images, use the website image extractor — it looks at src, which this href tool intentionally ignores.
Relative vs absolute: ../privacy and /privacy/ and https://yoursite.example/privacy/ are three different strings in the output. De-duplication is exact-string, so those three survive. Resolve them against the page’s base URL in the sheet (new URL(href, 'https://yoursite.example/blog/post/') in a console) before you decide they are unique pages. Trailing slashes matter for the same reason FlashKit’s own redirects are explicit 301s to the slash form.
If you only needed unique registrable domains (example.com, not every path), pipe the copied list into the domain extractor. That is the cleaner input for WHOIS or DNS follow-ups.
Copy-paste QA: after Extract Links, the heading shows Extracted Links (N). If N is 0, the paste had no quoted href — maybe you copied rendered text from the page instead of View Source, or the menu is a click handler with no href. SPAs that build <a href> only after hydration will look empty unless you copy from DevTools Elements once the DOM exists. The Copy button copies the textarea; there is still no “download .txt.” Use that N as a checksum: if the nav template should have 12 unique items and N is 40, you pasted the whole document including footer and related posts — that is fine, just filter in the sheet. If N is 12 and you expected 40, you pasted a partial component. Either way, the tool did not crawl, sort, or classify internal vs external; that last step is yours, which is what “then sort internal vs external links” in the search snippet means.