Cron Expression Generator

Pick when the job should run and get the cron expression, its meaning in plain English, the next 5 run times and ready-to-paste snippets.

Loading tool…

About the Cron Generator

A cron expression is five fields separated by spaces — minute, hour, day of month, month and day of week — and each field can be * (every value), a step such as */15, a list such as 0,15,30,45 or a range such as 9-17. The generator lets you choose one of these forms for every field and writes the expression for you: “every 15 minutes, from 9 to 17, Monday to Friday” becomes */15 9-17 * * 1-5. It works in both directions, so you can also type or paste an expression and see the controls move to match it. Syntax that has no control, such as L or MON#2, is kept exactly as typed.

The result is checked three ways: the description in words comes from the open-source cronstrue library, the next five run times are calculated by the same scheduler as the Cron Parser, and warnings point out the classic traps. The best known one is that cron ORs the two day fields: 0 0 13 * 5 runs on every 13th and on every Friday, not only on Friday the 13th. Another is that a step starts again at the beginning of the range, so */7 in the minute field runs at 0, 7 … 56 and then at 0 again, four minutes later.

Schedulers do not agree on the details, so the expression is also written in the dialects you are likely to need. crontab, GitHub Actions and Kubernetes CronJobs use five fields; GitHub always evaluates them in UTC and Kubernetes does too unless spec.timeZone is set. Spring and node-cron accept a sixth field for seconds in front. Quartz requires ? in either the day of month or the day of week, and counts weekdays from 1 = Sunday, which is why the Quartz form uses names such as MON-FRI instead of numbers.

How to use it

  1. Start from a quick template such as “Daily at time”, or go straight to the fields.
  2. For each field choose Every, Every n-th, Specific values or Range, and pick the values.
  3. Read the description and the next 5 runs to confirm the schedule does what you expect.
  4. Switch the next runs between local time and UTC to match the machine that will run the job.
  5. Copy the expression, or the snippet for crontab, GitHub Actions, Kubernetes, Spring or Quartz.

Frequently asked questions

How do I write a cron job that runs every 5 minutes?
Use */5 * * * *. The step */5 in the minute field matches minutes 0, 5, 10 … 55 of every hour. Click the “Every 5 minutes” template to get it, then restrict the hours or days if you need to.
Why does my job run on days I did not choose?
When both the day of month and the day of week are restricted, cron runs the job when either one matches. 0 9 1 * 1 runs on the 1st of the month and on every Monday. Leave one of the two fields as * and test the other condition inside the script.
Does GitHub Actions use my time zone?
No. The schedule event of GitHub Actions is always evaluated in UTC, the shortest interval is 5 minutes, and runs can start late when the service is busy. Switch the next runs to UTC to build a schedule for it.
What is the difference between cron and Quartz expressions?
Quartz has a seconds field in front and an optional year at the end, needs ? in one of the two day fields, and numbers the weekdays 1–7 starting on Sunday, whereas cron uses 0–6 (and 7) with Sunday as 0. The generator writes a separate Quartz form for that reason.

Related tools