# validator.js

> String validators and sanitizers for JavaScript

Source: https://talira.ai/catalog/validator-js-8jwvky98
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / validation / values](https://talira.ai/categories/libraries/validation/values), [languages / javascript](https://talira.ai/categories/languages/javascript)
- Licence: MIT[^2]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [Chris O'Hara](https://talira.ai/orgs/chris-ohara.md)

validator.js is a JavaScript library of string validators and sanitizers for Node.js and the browser. It checks whether a string is an email address, URL, IP address, UUID, credit card number, IBAN, ISBN, JWT, date, mobile phone number, postal code, strong password and many other formats, and sanitizes strings by trimming, escaping and normalizing them. It works on strings only, and each validator can be imported on its own or as tree-shakeable ES modules.

## Links

- GitHub: https://github.com/validatorjs/validator.js

## Problems it solves

- check whether a string is a valid email address in JavaScript
- validate a phone number or postal code for a given country in Node.js
- sanitize and normalize user input strings in a web form

## Features

- validators for email, URL, IP, UUID, IBAN, ISBN, credit card and many other formats
- locale-aware checks for mobile phone numbers, postal codes and identity cards
- sanitizers such as trim, escape, normalizeEmail and whitelist
- import single validators or tree-shakeable ES modules
- runs in Node.js and in the browser

## Limitations

- It validates and sanitizes strings only: anything else passed in throws an error.[^1]
- XSS sanitization was removed from the library; its README points to DOMPurify or xss-filters instead.[^1]

## Trust

Overall: 0.54 out of 1.
Signals: maintenance 0.46, adoption 0.88, momentum 0.63, community 1.00, backing 0.30, extensibility 0.00.

- last commit 2 months ago
- 1 commits in the last 90 days
- latest release 13.15.35 8 months ago
- 23.7k GitHub stars
- 592 contributors
- accepts sponsorship (Open Collective)
- backed by Chris O'Hara

## Alternatives

- [express-validator](https://talira.ai/catalog/express-validator-svs43fbd.md): Express middleware that validates and sanitizes requests with validator.js

## Sources

[^1]: https://github.com/validatorjs/validator.js/blob/master/README.md (checked 28 Nov 2026)
[^2]: https://github.com/validatorjs/validator.js/blob/master/LICENSE (checked 28 Nov 2026)
