[{"data":1,"prerenderedAt":195},["ShallowReactive",2],{"page:\u002Fen\u002Fguides\u002Fcompany-domain-from-email-address":3},{"id":4,"title":5,"body":6,"description":187,"extension":188,"meta":189,"navigation":190,"path":191,"seo":192,"stem":193,"__hash__":194},"pages\u002Fen\u002Fguides\u002Fcompany-domain-from-email-address.md","Getting the company domain from an email address",{"type":7,"value":8,"toc":179},"minimark",[9,25],[10,11,13,20],"page-head",{"updated":12},"21 October 2026",[14,15,17],"template",{"v-slot:title":16},"",[18,19,5],"p",{},[14,21,22],{"v-slot:lead":16},[18,23,24],{},"From an email address to the company's domain. And when there's no company behind it.",[26,27,28,33,62,66,77,84,88,91,134,137,141,148,157,163,167],"article-body",{},[29,30,32],"h2",{"id":31},"in-three-steps","In three steps",[34,35,36,45,56],"ol",{},[37,38,39,40,44],"li",{},"Take the part after the ",[41,42,43],"code",{},"@",", in lower case and without spaces.",[37,46,47,48,51,52,55],{},"Remove subdomains: ",[41,49,50],{},"mail.voorbeeld.nl"," becomes ",[41,53,54],{},"voorbeeld.nl",".",[37,57,58,59,55],{},"Skip addresses at email providers. There's no company behind ",[41,60,61],{},"gmail.com",[29,63,65],{"id":64},"subdomains","Subdomains",[18,67,68,69,72,73,51,75,55],{},"Under ",[41,70,71],{},".nl",", the domain sits directly before the extension. So the last two parts are the domain: ",[41,74,50],{},[41,76,54],{},[18,78,79,80,83],{},"Other extensions don't always work that way. With ",[41,81,82],{},".co.uk",", the last three parts belong to the domain. If you also work with foreign addresses, use the Public Suffix List instead of the last two parts.",[29,85,87],{"id":86},"email-providers","Email providers",[18,89,90],{},"An address at an email provider or internet provider says nothing about the company. Common ones in the Netherlands:",[92,93,94,114],"ul",{},[37,95,96,98,99,98,102,98,105,98,108,98,111],{},[41,97,61],{},", ",[41,100,101],{},"outlook.com",[41,103,104],{},"hotmail.com",[41,106,107],{},"live.nl",[41,109,110],{},"icloud.com",[41,112,113],{},"yahoo.com",[37,115,116,98,119,98,122,98,125,98,128,98,131],{},[41,117,118],{},"ziggo.nl",[41,120,121],{},"kpnmail.nl",[41,123,124],{},"planet.nl",[41,126,127],{},"home.nl",[41,129,130],{},"xs4all.nl",[41,132,133],{},"hetnet.nl",[18,135,136],{},"A list like this is never finished. Keep it in one place in your code, and add to it when you see sign-ups that don't belong to a company.",[29,138,140],{"id":139},"the-function","The function",[18,142,143,144,147],{},"Returns the domain, or ",[41,145,146],{},"null"," if there's no company behind the address:",[149,150,155],"pre",{"className":151,"code":153,"language":154,"meta":16},[152],"language-js","const providers = new Set([\n  'gmail.com', 'outlook.com', 'hotmail.com', 'live.nl', 'icloud.com', 'yahoo.com',\n  'ziggo.nl', 'kpnmail.nl', 'planet.nl', 'home.nl', 'xs4all.nl', 'hetnet.nl',\n])\n\nfunction companyDomain(email) {\n  const at = email.lastIndexOf('@')\n  if (at \u003C 0) return null\n  const host = email.slice(at + 1).trim().toLowerCase()\n  if (!host.includes('.')) return null\n  \u002F\u002F under .nl the last two parts are the domain\n  const domain = host.split('.').slice(-2).join('.')\n  return providers.has(domain) ? null : domain\n}\n\ncompanyDomain('info@mail.voorbeeld.nl') \u002F\u002F 'voorbeeld.nl'\ncompanyDomain('jan@gmail.com') \u002F\u002F null\n","js",[41,156,153],{"__ignoreMap":16},[18,158,159,160,162],{},"A ",[41,161,146],{}," here is an answer: there's no company domain. So don't store a company either.",[29,164,166],{"id":165},"next","Next",[18,168,169,170,173,174,55],{},"With the domain, you look up the company: ",[41,171,172],{},"GET \u002Fv1\u002Fcompanies?domain=voorbeeld.nl",". How that fits into a sign-up is on ",[175,176,178],"a",{"href":177},"\u002Fen\u002Fuse-cases\u002Fenrich-sign-ups","Enrich sign-ups",{"title":16,"searchDepth":180,"depth":180,"links":181},2,[182,183,184,185,186],{"id":31,"depth":180,"text":32},{"id":64,"depth":180,"text":65},{"id":86,"depth":180,"text":87},{"id":139,"depth":180,"text":140},{"id":165,"depth":180,"text":166},"From info@mail.voorbeeld.nl to voorbeeld.nl, and why you skip gmail.com and ziggo.nl. With a function you can copy as is.","md",{},true,"\u002Fen\u002Fguides\u002Fcompany-domain-from-email-address",{"title":5,"description":187},"en\u002Fguides\u002Fcompany-domain-from-email-address","EHXJyFXYpK7NxqcOD304spVCq1uRklXbeYlCOX0vFuM",1793465541364]