Cron Expression Validator
Validate a cron expression (5 or 6 fields) and indicate which field is wrong. Accepts lists, ranges and steps.
Formato 5 campos: minuto, hora, dia, mês, dia da semana. Formato 6 campos: segundo + os 5 anteriores.
Cron expressions: a tiny DSL for time-based scheduling
Cron is the lingua franca of recurring jobs on Unix. A cron expression is a compact string with five (sometimes six or seven) space-separated fields that describes "when" something should run. The job runner — crond, systemd timer, Kubernetes CronJob, GitHub Actions scheduler, Vercel Cron — wakes up every minute and fires every entry whose pattern matches the current wall clock.
Despite the surface simplicity, the syntax is full of dialect-specific surprises: 0-indexed vs 1-indexed weekdays, Quartz-only operators (L, W, #), AND vs OR logic between day fields, and timezone quirks. This validator checks structure and field ranges so that you catch syntax errors before pushing to production.
The classic 5-field Unix Vixie format
The original Vixie cron, shipped with most Linux distributions, uses five fields:
* * * * * command
| | | | |
| | | | +-- day of week (0-6, 0=Sunday; or SUN-SAT)
| | | +---- month (1-12 or JAN-DEC)
| | +------ day of month (1-31)
| +-------- hour (0-23)
+---------- minute (0-59)
Operators inside a field:
*— any value.,— list, e.g.1,15,30.-— range, e.g.1-5./— step, e.g.*/15(every 15) or10-30/5.L,W,#— only in Quartz: last day, nearest weekday, nth weekday of month.
Worked examples
0 9 * * 1-5— every weekday at 09:00.*/15 * * * *— every 15 minutes.0 0 1 * *— first day of every month at midnight.30 2 * * 0— every Sunday at 02:30.0 12 1 1 *— at noon on January 1st.0 0 * * 1#2— second Monday of every month (Quartz).
Dialects: Vixie, Quartz, AWS, Kubernetes, GitHub
Not all cron is the same cron:
- Unix Vixie cron — 5 fields, day-of-week 0-6 (Sunday=0 or 7).
- Quartz (Java) — 6 or 7 fields:
seconds minutes hours dom month dow [year], day-of-week 1-7 with Sunday=1. SupportsL(last),W(nearest weekday),#(nth weekday). - AWS EventBridge — 6 fields, year included, requires
?in either dom or dow. - Kubernetes CronJob — vanilla 5 fields, UTC by default; since 1.27 supports
timeZonein spec. - GitHub Actions — 5 fields, UTC only, minimum interval is 5 minutes, and runs can be skipped under heavy load.
- Vercel Cron — 5 fields, UTC, similar caveats.
Common pitfalls: weekday encoding and dom+dow logic
Two errors trip up almost every developer:
- Sunday is both 0 and 7 in Vixie cron — accepted for compatibility with original AT&T cron. In Quartz it is 1.
- day-of-month and day-of-week are ORed, not ANDed, when both are specified.
0 0 13 * 5fires on every 13th of the month and every Friday — not "Friday the 13th". - Step value
*/0is invalid;0/15is a Quartz-only form. - Named months/weekdays are not case-sensitive but must be three letters (
JAN,MON).
Brazil simplifies one thing: since 2019 the country has abolished daylight saving time, so a job scheduled for 02:30 BRT does not get skipped or duplicated twice a year as it would in the US or EU.
Tooling: validate, decode and preview next runs
Recommended libraries and sites:
- crontab.guru — the canonical visual decoder; pastes a cron and writes the English meaning.
- cronstrue (npm) — human-readable description in many languages.
- cron-validator, cron-parser (npm) — parse, validate and compute next/prev runs in Node.
- Quartz (Java) — full Quartz dialect with
CronExpression. - croniter (Python) — Vixie-compatible iteration of next executions.
FAQ
5 or 6 fields — which one should I use?
Unix-flavored runners (Vixie, GitHub Actions, Kubernetes, Vercel) want 5 fields. Quartz and AWS EventBridge use 6+; only switch to that layout if your runner explicitly supports it.
Is the relation between dom and dow AND or OR?
OR. When both fields are restricted, the job fires whenever either condition matches. To express "Friday the 13th" you must restrict to one of them and check the other inside the job.
How do I preview the next runs before deploying?
Paste the expression into crontab.guru or run cron-parser in Node to enumerate the next N firings. For GitHub Actions, you can use the workflow_dispatch event to trigger manually for testing.
Which timezone is used?
Most managed runners (GitHub Actions, Vercel, AWS) execute in UTC. Linux crond uses the system timezone (/etc/localtime). Kubernetes 1.27+ supports an explicit timeZone field in the CronJob spec.
Why does my GitHub Actions cron sometimes run late?
GitHub queues scheduled workflows on a best-effort basis. Under peak load, runs can be delayed by several minutes or even skipped entirely. For strict timing, use a dedicated scheduler.
Related Tools
CPF Validator
Validate Brazilian CPF numbers instantly using the official algorithm. Useful for testing document validation in applications. No data sent to servers.
Batch CPF Validator
Validate a list of CPFs (one per line) and see which are valid and which are not. No data sent to servers.
Batch CNPJ Validator
Validate a list of CNPJs (one per line) with a summary of valid, invalid and total. No data sent to servers.