Back to library
Clay formula

Normalize a messy website URL

Turns any URL variant into a bare lowercase root domain for reliable joins.

Columns it needs

Website

The snippet

LOWER(REGEX_REPLACE(REGEX_REPLACE(TRIM({{Website}}), "(?i)^https?://", ""), "(?i)^www\\.|/.*$", ""))

How to use it

  1. 1Run this on every source before merging tables.
  2. 2Join tables on the normalized domain, never on the raw website field.
domainnormalizecleanup

Related patterns