cron-validator

An MIT-licensed JavaScript cron syntax validator with configurable grammar options.

github.com/GuillaumeRochat/cron-validator
cron-validator homepage screenshot

About cron-validator

cron-validator is a JavaScript utility that checks whether a cron expression is valid. The project describes it as a way to validate cron expressions in your own code base, similar to what crontab guru does in a browser. It is intended for checking an expression before it is sent to an external system. It is MIT-licensed and free.

The library is used by calling isValidCron, with support for both require and TypeScript import syntax. Several behaviours are off by default and must be enabled through options, including seconds fields, month and weekday aliases, the ? blank-day symbol, the digit 7 as Sunday, and n-th weekday expressions such as tue#2. The README states that it validates expressions and does not schedule jobs. For range restrictions and preset configurations, the README points to a different library, cron-validate.

Key features

  • Optional seconds field, enabled with the seconds option
  • Optional month and weekday alias support, enabled with the alias option
  • Optional blank day notation using the ? symbol
  • Optional n-th weekday of month syntax such as tue#2
  • Weekday ranges 0-6 and 1-7, with digit 7 as Sunday available as an option
  • Explain mode that returns the fragments in error
Best for: JavaScript and TypeScript developers who need to check cron expressions in their code before passing them to another system.
Good for
  • Free and open source under the MIT license
  • Strictness and accepted syntax can be adjusted through options
  • Explain mode identifies which parts of an expression are in error
Watch out for
  • Several syntax extensions are off by default and must be enabled per call
  • It validates expressions and does not schedule jobs
  • The README directs users to cron-validate for range restriction and preset configurations

cron-validator at a glance

Type
Online tool
Pricing
Free
Open source
Yes
Last checked
Oct 9, 2026 · Online when checked
Listed
Oct 9, 2026

cron-validator alternatives

Tools and sites you could use instead, ranked by how closely they match.

All 3 alternatives

cron-parser

github.com/harrisiirak/cron-parser

An MIT-licensed JavaScript and TypeScript library for parsing cron expressions and calculating execution dates.

FreeOpen source
7 alternatives

cRonstrue

github.com/bradymholt/cRonstrue

An MIT-licensed library for turning cron expressions into readable descriptions in several languages.

FreeOpen source
6 alternatives

Regex Syntax Cheatsheet

developer.mozilla.org/en-US/docs/Web/JavaScrip…

Use the MDN regular expression cheat sheet to look up JavaScript RegExp syntax and related capabilities.

Popular in Web Development

Well-known listings from the same topic.

All 122

cron-validator FAQ

Does this library run scheduled jobs?
No. The README describes it as a validator for cron expressions. It contrasts itself with node-cron, which is primarily used to schedule jobs.
How do I allow seconds in a cron expression?
Pass the seconds flag as true in the options argument, for example isValidCron('* * * * * *', { seconds: true }).
Is something wrong or out of date?

Tell us and an editor will check it.

Own this website?

Claim the listing and suggest updates yourself. An editor checks every claim first.

Claim this listing