Reading:
Cron Expressions Explained: A Practical Guide

Cron Expressions Explained: A Practical Guide

Metamug

//: # ()

Have a cron string you're staring at right now? Use our free Cron Expression Parser & Explainer — paste it and get a plain-English summary plus the next 5 run times, computed instantly in your browser.

Where cron comes from

cron is a scheduler daemon that has shipped on Unix systems since the 1970s. Its scheduling syntax — five space-separated fields describing minute, hour, day, month, and weekday — has outlived the daemon itself and shows up everywhere: crontab -e on a Linux box, Kubernetes CronJob resources, GitHub Actions schedule: triggers, AWS EventBridge (formerly CloudWatch Events) rules, and most job schedulers in application frameworks.

The five fields

┌───────────── minute (0 - 59)
│ ┌───────────── hour (0 - 23)
│ │ ┌───────────── day of month (1 - 31)
│ │ │ ┌───────────── month (1 - 12)
│ │ │ │ ┌───────────── day of week (0 - 6) (Sunday = 0)
│ │ │ │ │
* * * * *

Each field can be:

  • *``** — every value ("any")
  • A number — 0, 15, 9
  • A list — 1,15,30
  • A range — 9-17
  • A step — */15 (every 15 units), or 10-20/2 (every 2nd unit from 10 to 20)
  • Names (month and weekday only) — MON, FRI, JAN, DEC

Common schedules, decoded

Expression Meaning
* * * * * Every minute
*/15 * * * * Every 15 minutes
0 * * * * Once every hour, on the hour
0 0 * * * Once a day, at midnight
0 9 * * 1-5 9am, Monday through Friday
0 0 1 * * Midnight on the 1st of every month
0 0 1 1 * Midnight on January 1st (yearly)
*/5 9-17 * * 1-5 Every 5 minutes, 9am-5pm, weekdays only

Most schedulers also support shorthand strings: @daily / @midnight (= 0 0 * * *), @hourly (= 0 * * * *), @weekly (= 0 0 * * 0), @monthly (= 0 0 1 * *), @yearly / @annually (= 0 0 1 1 *).

The one rule that trips everyone up

When both the day-of-month field and the day-of-week field are restricted (neither is *), most cron implementations treat them as an OR, not an AND. For example:

0 0 15 * 5

This does not mean "the 15th, if it's a Friday." It means "midnight on the 15th of the month, OR every Friday at midnight" — whichever comes first, both apply independently. This is standard POSIX cron behavior (Vixie cron, the Linux default), though a few tools (like Quartz, used in Java) deliberately break from this and require one of the two fields to be ? instead. Always check which flavor your scheduler uses before relying on day-of-month + day-of-week together.

Cron vs. the newer alternatives

Cron expressions are powerful but write-only for most people — nobody reads */15 9-17 * * 1-5 and immediately knows it means "business hours, every 15 minutes" without checking. That's exactly the gap a plain-English explainer closes, and it's also why some newer schedulers (like AWS EventBridge Scheduler and Temporal) additionally support rate-based expressions (rate(5 minutes)) for the simple cases, falling back to cron syntax only when you need something cron-shaped, like "every weekday at 9am."

Try it

Paste your cron expression into the Cron Parser & Explainer to see each field broken down, a plain-English summary, and the next 5 times it will actually fire.



Icon For Arrow-up
Comments

Post a comment