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.
Runs entirely in your browser. Nothing you paste or open is uploaded.
0 links 0 domains 0 duplicates removed 0 filtered out 0 relative links skipped read as text
Links copied. Open the Bulk URL Opener in a new tab and paste them into its box.
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.
How to Extract URLs From Text
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.
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.
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.
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.
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.
How Does This Link Extractor Work, and Is My Text Uploaded?
Nothing you paste or drop is uploaded. The page downloads once, and after that every step runs as JavaScript inside your own browser tab. There is no server step, no account, and nothing is saved when you close the tab. You can load the page, switch off your network connection and it still works.
For plain text, the extractor runs a pattern match over the text in chunks of about half a megabyte, pausing between chunks so the page stays responsive on large files. It looks for three shapes: anything that starts with a scheme followed by two slashes (https://, http://, ftp://, file://, chrome://), anything that starts with www., and, if you allow it, bare names such as example.com/pricing whose last part is a real top-level domain. Each match is then trimmed and checked with the browser’s own URL parser, the same WHATWG URL Standard code the address bar uses, so anything that can’t be parsed as a URL is dropped.
For HTML, the extractor hands the markup to the browser’s DOMParser, which builds a document without running any of its scripts or loading any of its images. It then reads the href of every a and area element, and the src of every img if you ask for images. It also scans the visible text for addresses that aren’t wrapped in a link, which is common in emails.
For email files (.eml), it first decodes quoted-printable text, the encoding that breaks long lines with an equals sign and writes = as =3D, and decodes base64 text parts. Without that step, links in newsletters come out split in half.
Because nothing is sent anywhere, the tool can’t visit a web page for you. To pull links from a live page, use the console snippet or the bookmarklet in the tool box above; both run in your own browser on the page you have open.
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 paste | What you get | Why |
|---|---|---|
| See https://example.com/docs. | https://example.com/docs | A 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/a | An unmatched closing parenthesis is dropped |
| [docs](https://example.com/x) | https://example.com/x | Markdown brackets are never part of a link |
| www.example.com/about | https://www.example.com/about | www. addresses get https:// added |
| example.com/pricing | https://example.com/pricing | A bare domain counts if its ending is a real top-level domain and the option is on |
| notes.md, build.sh, v1.2.3 | Nothing | File names and version numbers are not domains |
| [email protected] | Nothing | Email addresses are skipped; they are not web links |
| https://a.com,https://b.com | Two links | Links pasted back to back are split at the second scheme |
| https:\/\/api.example.com\/v1 | https://api.example.com/v1 | Escaped slashes from JSON are unescaped first |
Extract Links From HTML vs Extract URLs From Plain Text
The same page can give two very different lists depending on how you read it. In plain text, a link is whatever you can see. In HTML, a link is the href attribute behind the words, and the words themselves may say “Click here” or “Read more”. If you copy a web page and paste it as plain text, the addresses behind those words are gone. If you paste the page source instead, the HTML mode can recover every one of them, with its anchor text.
HTML mode also has to deal with relative links. A link such as /pricing or ../guide.html only means something relative to the page it came from. Enter that page’s address in the base URL box and each relative link is resolved to a full address, following the same rules the browser uses when you click it. If the HTML has its own base element, that is used when you leave the box empty. Without a base, relative links are counted as skipped rather than guessed.
Links that aren’t really links are left out in HTML mode: javascript: pseudo-links, data: URLs and empty href attributes. mailto: and tel: links are kept only when you untick “Only http and https”, since they are addresses but not pages.
| Plain text mode | HTML mode | |
|---|---|---|
| Reads | The characters you can see | href of a and area tags, src of img tags (optional), plus visible text |
| “Click here” links | Lost; only the words remain | Kept, with “Click here” as anchor text |
| Relative links (/about) | Not recognised | Resolved against your base URL or the page’s base element |
| Anchor text in CSV | No | Yes, in the anchor_text column |
| Best for | Chat logs, notes, documents, CSV columns | Page source, saved .html files, email HTML |
How to Extract Links From a PDF, Word File or Email
The tool reads text formats directly. For other formats the trick is to get the document into a text or HTML form first, without losing the links hidden behind words.
- Word (.docx): choose File, Save As, and pick Web Page (.htm or .html). Drop that file here and the HTML mode reads every hyperlink with its display text. Alternatively, press Alt+F9 on Windows (Option+F9 on a Mac) to show field codes, which reveal each link as a HYPERLINK field, then copy and paste the text.
- Google Docs: choose File, Download, Web page (.html, zipped). Unzip it and drop the .html file here.
- PDF: open the file in your browser’s PDF viewer, select all and copy, then paste here. Addresses that are printed on the page come through. Links hidden behind words are stored as PDF annotations and don’t survive a copy, so for those you need a PDF editor that can list link annotations.
- Gmail: open the message, choose the three-dot menu, then Download message. That saves an .eml file you can drop here. Show original gives the same raw message in a tab if you’d rather copy it.
- Apple Mail: select the message and choose File, Save As, with the format set to Raw Message Source. The saved file is a standard email message you can drop here.
- Spreadsheets: copy the column and paste it. For a CSV export, drop the file; every cell is scanned.
Outlook’s .msg format is a binary container, not text, so drop the message into a folder as .eml from a client that supports it, or open it and use Save As with an HTML format.
How to Extract All Links From a Web Page
To extract every link from a page you have open, run a one-line snippet in the browser’s developer console, or click a bookmarklet. Both read document.links, the browser’s own list of every a and area element with an href, so they see links added by scripts after the page loaded, which a copy of the page source would miss.
The console snippet in the tool box above keeps only http and https links, removes duplicates and puts the result on your clipboard with copy(), a console helper that Chrome, Edge, Firefox and Safari all provide. Paste the result straight into this extractor to filter it by domain or export it.
The first time you paste into the console, Chrome (since version 120) and Firefox show a self-XSS warning and ask you to type “allow pasting”. That warning is there to stop people being tricked into running code they don’t understand. The snippet only reads links and copies them, but it is worth reading any code before you paste it, including ours.
The bookmarklet does the same job without the console. Drag it to your bookmarks bar, open any page and click it: a box appears over the page with every link, already selected, and the list is copied to your clipboard where the browser allows it. Press Escape to close the box.
| Browser | Open the console | Paste warning | Bookmarklet |
|---|---|---|---|
| Chrome | Ctrl+Shift+J (Windows, Linux), Cmd+Option+J (Mac) | Type “allow pasting” once (Chrome 120 and later) | Drag to the bookmarks bar (Ctrl+Shift+B shows it) |
| Edge | Ctrl+Shift+J or F12, then Console | Same Chromium DevTools warning | Drag to the favorites bar |
| Brave | Ctrl+Shift+J (Windows), Cmd+Option+J (Mac) | Same Chromium DevTools warning | Drag to the bookmarks bar |
| Opera | Ctrl+Shift+I (Windows), Cmd+Option+I (Mac), then Console | Same Chromium DevTools warning | Add as a bookmark, then run it from the bookmarks bar |
| Vivaldi | Ctrl+Shift+I (Windows), Cmd+Option+I (Mac), then Console | Same Chromium DevTools warning | Drag to the bookmark bar |
| Arc | Cmd+Option+I, then Console | Same Chromium DevTools warning | No bookmarks bar, so the console snippet is the easier route |
| Firefox | Ctrl+Shift+K (Windows, Linux), Cmd+Option+K (Mac) | Type “allow pasting” until you have used the console a few times | Drag to the bookmarks toolbar |
| Safari (Mac) | Turn on Settings, Advanced, “Show features for web developers”, then Cmd+Option+C | No paste warning | Drag to the Favorites bar |
A few sites with strict security settings can stop a bookmarklet from running. If nothing happens when you click it, use the console snippet instead.
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.
URL Extractor vs Other Ways to Pull Links
There are several ways to get links out of text. Each one is the right choice for someone; here is an honest take on each.
| Method | Good for | Catch | Verdict |
|---|---|---|---|
| This URL extractor | Any pasted text, HTML, email or text file, with filters and exports | Can’t fetch a live page for you, and can’t read PDF or .docx files directly | Best general choice when you have the text |
| Console snippet or bookmarklet | Every link on a page you have open, including links added by scripts | No filters or exports on its own | Best for live pages; pair it with this tool |
| Find and replace with regex (VS Code, Notepad++) | Developers already in an editor | Hand-written patterns often keep trailing punctuation or split Wikipedia links | Fine if you already know regex |
| Excel or Google Sheets formulas | Links already in cells, or HYPERLINK formulas | Links inside longer text need REGEXEXTRACT or scripts | Good for tidy columns only |
| Command line (grep -o) | Huge log files and automation | Needs a terminal and a good pattern | Best for scripts, overkill for one-off jobs |
| Browser extensions for link grabbing | Selecting links on pages as you browse | Extensions that read every page need broad permissions | Worth it only if you do this daily |
| BelayTab | Saving a set of open tabs as a session and reopening it later | It saves tabs, it doesn’t scan text | The next step once the links are open in tabs |
What to Do With the List of Links
Once the list is clean, the next step depends on why you wanted it. The downloads cover the common cases: TXT for pasting into another tool, CSV for a spreadsheet or an SEO audit, and bookmarks.html for importing into any browser as a folder you can open in one go.
To open every link, press “Copy for Bulk URL Opener” and paste the list into the Bulk URL Opener, which opens them in batches so your browser doesn’t stall. If the list has near-duplicates, such as the same page with and without a trailing slash or with tracking parameters, run it through Remove Duplicate Lines in URL mode or the URL Cleaner first. If you started with a sitemap rather than text, the Sitemap URL Extractor reads sitemap.xml files directly.
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
- ToolsBulk URL OpenerPaste a list of links and open them all at once, or save them as a session.
- ToolsRemove Duplicate LinesDelete repeated lines from any list, sort what’s left, and merge URLs that point to the same page.
- ToolsURL CleanerRemove tracking parameters like utm_*, fbclid and gclid from one link or a whole list, and see what each one did.
- ToolsSitemap URL ExtractorExtract URLs from any XML sitemap, sitemap index or .xml.gz file. Filter, dedupe and export to CSV or TXT.
Keep Your Tabs Safe, Too
BelayTab saves and snapshots your tabs automatically, in every browser. Free.