Open source

A JavaScript library to work easily with complex domain names, subdomains and well-known TLDs.

Become a contributor

Financial contributions

Custom contribution


Make a custom one time or recurring contribution to support this collective.
Recurring contribution


Consider this if your company uses tld.js for one or many products. Your logo+link to your websi... Read more

Starts at

$100 USD / year

tld.js is all of us

Our contributors 2

Everyone who has supported tld.js. Individuals and organizations that believe in –and take ownership of– our purpose.

Thomas Parisot
Collective Admin
Collective Admin


It answers with accuracy to questions like what is's domain?, what is's subdomain? and is's TLD a well-known one?.

tld.js runs fast, is fully tested and is safe to use in the browser (with browserify, webpack and others). Because it relies on Mozilla's public suffix list, now is a good time to say thank you Mozilla!


npm install

Using It

const {parse, tldExists} = require('tldjs');

// Checking only if TLD exists in URL or hostname
// First TLD exists; the second does not.

// Retrieving hostname related informations of a given URL

This project is used by many projects such as Brave authorship programme,, Standuply and Ghost.


Because this project relies on Mozilla Public Suffix project, it would be sensible that a fare share of our donations goes back to them.