HTML Links to CSV

Extract all links from HTML code and save them in a CSV.

About HTML Links to CSV

Auditing a page's links, building a list of resources from a directory page or collecting every download link on a site starts with the same tedious step: pulling the anchors out of the HTML. This tool parses the HTML you paste, finds every <a> element and writes a CSV with the link text and the href of each one.

Paste the HTML source, click Extract and download the CSV. The page is parsed in your browser, so nothing is fetched or uploaded.

How to use HTML Links to CSV step by step

  1. Copy the HTML of the page or section (view source, or Copy outerHTML in the developer tools) and paste it into the HTML box.
  2. Click "Extract links to CSV". The result box shows one row per link with two columns: link text and URL.
  3. Type a file name and click "Download CSV".

Input and output example

Input

<ul>
  <li><a href="/pricing">Pricing</a></li>
  <li><a href="https://docs.example.com">Docs</a></li>
</ul>

Output

texto_del_enlace,url_del_enlace
"Pricing","/pricing"
"Docs","https://docs.example.com"

Why use our HTML Links to CSV?

Common use cases

Limits and tips

Frequently asked questions

What columns does the CSV contain?

Two: texto_del_enlace (the visible text of the link) and url_del_enlace (the value of the href attribute). Both values are wrapped in double quotes so that commas in link text do not break the CSV.

Why are some links missing?

Links inserted by JavaScript after the page loads are not in the HTML source. Copy the element from the developer tools, which reflects the rendered DOM, or use the URL Extractor tool on the page text if the URLs are visible as text.

Can I extract links from a URL directly?

Not with this tool: it works on HTML you paste. Open the page, copy its source and paste it here. The Convert Web to Text tool fetches a URL through a proxy but returns text, not links.

What is the difference between this tool and the URL Extractor?

HTML Links to CSV reads the <a> elements of HTML and returns text plus href, including relative links. URL Extractor scans any plain text for strings starting with http:// or https:// and returns only the URLs it finds.

Is the HTML uploaded?

No. The HTML is parsed with the DOMParser in your browser and the CSV is created locally.

Related tools

Other free utilities you may find useful

Available languages