Orpheus

Cron Expression Explainer

What a schedule actually means, in a sentence.

Options
Break down each field
Result

Everything is processed in this tab. Nothing you paste is sent anywhere.

Every tool runs entirely in your browser. Your files are never uploaded to a server.

A cron expression has five fields: minute, hour, day of month, month, day of week. "*/15 * * * *" means every fifteen minutes; "0 3 * * 1-5" means at 03:00 Monday to Friday.

How to use Cron Expression Explainer

  1. Paste your expressions. One per line. Shorthand like @daily is expanded for you.
  2. Read the sentence. Each expression is described in plain language.
  3. Check the field breakdown. Every field is labelled, and invalid ranges are named rather than ignored.

About reading a cron expression

Cron expressions are compact to the point of being cryptic, and the compactness is the problem: five numbers in a row give no clue which position means what, so a schedule that is one field out looks entirely reasonable until it fires at the wrong time. Reading them back in plain language is the fastest way to check one before it goes into production. The rule most worth knowing is how the two day fields interact. Day of month and day of week are combined with OR rather than AND whenever both are restricted, which is the opposite of what almost everyone assumes. The expression meaning "the 13th" and "Friday" does not mean Friday the 13th — it runs on every 13th and on every Friday, roughly nine times a month instead of once or twice a year. The convention exists for historical compatibility and is not going to change, so the practical defence is to leave one of the two fields as an asterisk unless you specifically want the union. Time zones cause the other common class of surprise. Cron uses whatever the host is configured to, which on cloud infrastructure usually means UTC rather than the local time the schedule was written for. Daylight saving compounds it: a job scheduled inside the hour that gets skipped in spring may not run at all that day, and one inside the repeated autumn hour may run twice.

Frequently asked questions

What do the five fields mean?
In order: minute (0 to 59), hour (0 to 23), day of month (1 to 31), month (1 to 12) and day of week (0 to 6, where 0 is Sunday). An asterisk means every value of that field.
What does the slash mean in */15?
It is a step. Applied to an asterisk it means every nth value, so */15 in the minute field fires at 0, 15, 30 and 45. Applied to a range, 10-20/2 fires at 10, 12, 14, 16, 18 and 20.
Why did my job run on the wrong day?
Almost certainly the day-of-month and day-of-week trap. When both fields are restricted, cron runs when either matches, not both — so "0 0 13 * 5" fires on the 13th and on every Friday, not only on Friday the 13th. Leave one field as an asterisk to avoid it.
What time zone does cron use?
Whatever the machine or scheduler is set to, which is a frequent source of surprise on cloud platforms that default to UTC. Jobs scheduled around a local business hour also shift when daylight saving changes, and a job in the skipped hour may not run at all.
What are @daily and @hourly?
Shorthand supported by most implementations. @hourly is 0 * * * *, @daily is 0 0 * * *, @weekly is 0 0 * * 0, @monthly is 0 0 1 * * and @yearly is 0 0 1 1 *. They are expanded here so you can see what they become.

Last updated