Extract domain from a URL in Google Sheets

Extract Domain From Any URL in Google Sheets: 1 Easy Formula

Quick Summary

  • Beginners paste full links, page addresses and mixed formats into the Website column.
  • One formula can extract domain names from any link: it removes https, www, pages and extra codes.
  • With one clean format, the duplicate check finally works.
  • Paste in one column, read the clean domain in the next.

When I check beginner vendor sheets, the Website column is usually a mess. Full links, product pages, tag pages, cut-off addresses like houseandgarden.co. and even an email address typed where a website should be. The same site appears in three formats, so nobody notices it is a duplicate.

In my student sheet I solved this with one formula. Students paste any link into a column called Paste Link Here, and the next column shows only the clean domain. In this guide I show you how to extract domain names the same way, step by step.

Why you should extract domain names

For guest posting we deal with a website, not a single page. A clean domain like site.com has three benefits:

  • Duplicates become exact matches, so a highlight rule or Ctrl + F catches them. I explain those checks in duplicates in Google Sheets.
  • Your list looks professional when you share sites with a client.
  • Sorting and filtering work properly.
Links turned into one clean domain in Google Sheets

The formula

Put your links in column B, starting in row 2. In C2, paste this formula and copy it down:

=IF(TRIM(B2)="","",REGEXREPLACE(REGEXREPLACE(LOWER(TRIM(B2)),"^(https?://)?(www\.)?",""),"[/?#:].*$",""))

I tested this exact pattern in my student sheet. Two real examples:

  • https://www.homedecorblog.com/write-for-us/?ref=abc becomes homedecorblog.com
  • http://Atomic-Ranch.com/interior-design/ becomes atomic-ranch.com

Need help with GBOB outreach? Get a one-to-one consultation for just $5.

Contact Us

How the formula works, in plain words

  1. TRIM removes extra spaces, and LOWER turns capital letters into small ones, so Site.com and site.com match.
  2. The inner REGEXREPLACE removes the start of the link: https://, http:// and www.
  3. The outer REGEXREPLACE removes everything after the domain: the page path, question marks, hash codes and port numbers.
  4. IF keeps the cell empty when you have not pasted anything yet.

Google explains the function on its official REGEXREPLACE help page.

What the extract domain formula removes from a link

One formula for the whole column

In my student sheet I used an ARRAYFORMULA in the header cell, so the whole column fills by itself and students cannot break it by typing over a row. Beginners can start with the simple version above. Either way, the rule is the same: students type in the link column only and never in the domain column.

What the formula cannot fix

It can extract domain names, but it cannot tell you if the site is good. A store, a platform or a free subdomain still needs to be rejected by you. Also check that the link was complete: a cut-off address gives a cut-off domain. If something looks wrong, open the site. My guest post vendor list case study shows how many bad sites a quick check removes.

Before you trust any formula, test it. Paste five different links from your list into the link column: a homepage, a write for us page, a page with a question mark code, a link with capital letters and a link without https. Check that each one becomes a short domain with no slash at the end. If one does not, look at the original link. Often it was cut off or had a space in the middle.

Once the test passes, copy the formula down the whole column and protect that column, so nobody types over it by mistake. In Google Sheets you can protect a range from the Data menu. Then students only paste in the link column, and the sheet does the rest. When you extract domain names this way, every duplicate check, filter and client list built on that column works properly.

If you teach a group, set the formula up once in a master copy and give every student a copy of that file. Then nobody has to type it, and every sheet in the class follows the same format.

3 mistakes to avoid

  • Do not type in the domain column. Paste links in the link column only.
  • Do not paste an email address as a website.
  • Do not trust a cut-off link. Copy the full address again.

Frequently Asked Questions

How do I extract domain names in Google Sheets?

Use REGEXREPLACE to remove the start of the link (https and www) and everything after the domain, together with LOWER and TRIM.

Does the formula keep subdomains?

Yes. It removes only www. Other subdomains stay, which helps you spot free blog subdomains.

Students can paste any link without thinking about format, and the formula gives one clean domain every time.

Can I use the domain column for duplicate checks?

Yes. Clean domains make duplicate highlights and Ctrl + F reliable.

Want to learn the full GBOB process? One-to-one GBOB training is $35 for one month (intermediate level). Complete beginners get 1.5 months with extra attention. Contact us for details.

Contact Us for Details
Scroll to Top