Cron Expression Generator & Explainer
Explain a cron expression in plain words, list its next run times, or build one by picking a schedule
Loading the tool…
Explains a cron expression in plain words, lists its next 10 run times, and builds an expression from a schedule you pick. Use it to write a crontab or scheduler setting, or to check an existing schedule.
How to use
- Type an expression such as 30 9 * * 1-5 into "Cron expression or crontab line". A whole crontab line with its command also works.
- Read "In plain words" and "Field by field", choose this device or UTC as the "Time zone", and check the "Next 10 runs".
- To make a new one, choose "Repeat", a time and days under "Build an expression", or press "Use" next to one of the "Common examples".
- Press "Copy expression" and paste it into your crontab or configuration file.
How it works
- Standard cron has five fields: minute, hour, day of month, month and day of week (0 to 7, where 0 and 7 are Sunday). A 6-field form with seconds first and aliases such as @daily are also read.
- Switching the "Dialect" to "Quartz (Java, Spring)" allows ?, L, W, # and a year field, and day of week becomes 1 to 7 (1 is Sunday).
- When both day of month and day of week are restricted, the job runs when either one matches. If either field starts with *, both must match. A syntax error is shown with its character position.
Questions and answers
- What is the cron expression for every day at 3 AM?
- 0 3 * * *. Minute 0, hour 3 and every value in the other fields, so it runs daily at 03:00.
- How do I run a cron job every 5 minutes?
- Put */5 in the minute field: */5 * * * *. It runs at minute 0, 5, 10 and so on.
- How do I run a job only on weekdays at 9 AM?
- 0 9 * * 1-5. Day of week 1-5 is Monday to Friday.
- Does 0 0 13 * 5 run only on Friday the 13th?
- No. Standard cron runs it on every 13th of the month and on every Friday, because restricting both day fields means either one is enough.