Skip to content
PocketDesk
Your files are processed on your device, never uploaded

Cron expression explainer

  • On device
Input
Ln 1, Col 11 line0 BUTF-8

Paste, drop or open a file in Input to see the result here.

Waiting for input
  • ⌘Enter Run now
  • ⌘⇧C Copy result
  • ⌘F Find in result
  • Esc Exit full screen
  • Use Ctrl instead of ⌘ on Windows and Linux

How to read a cron expression

  1. Type or paste the expression, for example */15 9-17 * * MON-FRI.
  2. Read the plain English sentence at the top of the result.
  3. Check the next 5 runs underneath to confirm the schedule does what you expect. Use the option at the top to see them in your local time or in UTC.

If the expression is not valid, the tool tells you which field is wrong.

What the five fields mean

A cron expression has five fields separated by spaces, in this order: minute (0 to 59), hour (0 to 23), day of month (1 to 31), month (1 to 12 or JAN to DEC) and day of week (0 to 7 or SUN to SAT, where both 0 and 7 mean Sunday).

Each field accepts a few forms:

  • * means every value.
  • 5,10,15 is a list.
  • 9-17 is a range.
  • */10 is a step: every 10th value. 5-30/5 is a step inside a range.
  • Names such as JAN or MON can replace numbers in the month and weekday fields.

Shortcuts like @hourly, @daily, @weekly, @monthly and @yearly are expanded to the matching five fields.

Next run times

The sentence comes from the cronstrue library. The next run times are calculated by a small parser written for this tool. It walks forward day by day, so it handles month lengths and leap years correctly: a job set for February 29 is shown in the next leap year, and a job set for the 31st skips short months. If a schedule can never run, such as February 31, the tool says so.

Tips

  • A job with both day of month and day of week set runs on either, which surprises many people. 0 0 1 * 1 runs on the 1st and on every Monday.
  • Servers usually run cron in UTC. Check the time zone of your machine before you rely on a local hour.
  • Avoid * * * * * for heavy jobs. It runs every minute.
  • Daylight saving time can skip or repeat an hour in local time. UTC does not.
  • Convert the run times to epoch values with the Unix timestamp converter, or test log patterns with the regex tester.

The tool runs in your browser, and nothing is uploaded.

Questions

What cron format is supported?

The standard 5 fields: minute, hour, day of month, month and day of week. Lists, ranges, steps, month and weekday names (JAN, MON) and macros such as @daily work.

How is day of month combined with day of week?

As in standard cron: if both are restricted, the job runs when either matches. If one is a star, only the other is used.

Are the run times in my time zone?

By default yes, using your device's time zone. Switch to UTC with the option at the top, which is what most servers use.

Does it support seconds or Quartz symbols like L and ?

No. This tool reads the common 5 field Unix format. Expressions with seconds or Quartz symbols show a clear error.

Is my expression sent anywhere?

No. Parsing, the explanation and the next run times are all computed in your browser.

More developer tools