Cron expression generator
Choose how often the job should run, then the days and the time, and the cron expression appears with a sentence saying what it does and when it runs next. Nothing to memorise, and nothing leaves this tab.
How to use it#
- Choose how often: at an interval of minutes or hours, daily, weekly, or monthly.
- Fill in what that needs, such as the time of day, the weekdays, or the day of the month.
- Pick the scheduler the expression is for: standard cron, Quartz, Spring, or AWS EventBridge.
- Check the sentence and the next runs, then copy the expression.
What each choice writes#
Every 15 minutes is */15 * * * *, which runs at minutes 0, 15, 30, and 45 of every hour. Every hour on the hour is 0 * * * *, hourly at 30 minutes past is 30 * * * *, and every 6 hours at half past is 30 */6 * * *, at 00:30, 06:30, 12:30, and 18:30. The steps on offer are the ones that divide the hour or the day evenly. Every 7 minutes can be written, but it runs at 56 and then again at 0, four minutes later, which is rarely what anyone wants.
Daily at 09:30 on weekdays is 30 9 * * 1-5. Weekly on Monday, Wednesday, and Friday at 18:00 is 0 18 * * 1,3,5. Every day at midnight is 0 0 * * *, and monthly on the 1st at midnight is 0 0 1 * *. The sentence under the expression is the same reading the cron expression explainer gives, so what it says is what the expression means, not a description of the choices you made.
Standard cron, Quartz, Spring, and AWS#
Linux crontab, GitHub Actions schedules, and Kubernetes CronJobs all read the same five fields: minute, hour, day of the month, month, and day of the week. That is what the builder writes unless you choose otherwise. The shortest interval GitHub Actions runs a schedule at is every 5 minutes, and a run can start several minutes late when GitHub is busy. Weekdays come out as numbers there, 0 for Sunday, because crontab accepts a name only on its own, not in a range such as MON-FRI.
Quartz and Spring put a seconds field first, which is always 0 here, so the job fires on the minute. Quartz also needs a ? in whichever day field the schedule leaves open. AWS EventBridge keeps the minute first, adds a year on the end, needs the same ?, and is written inside cron(). The three count weekdays differently, so for them the days are written as names, MON-FRI, which each reads the same way. Steps are written from zero, as 0/15, which Quartz and AWS require.
The last day of the month, and months that are too short#
A job on the 31st does not run in April, June, September, or November, and a job on the 30th skips February. Cron does not move it to the last day that month has; it simply finds no matching date. The builder says so when you pick a day after the 28th, and the next runs show which months it lands in.
For the last day of every month, pick Last day. Quartz, Spring, and AWS write that as L. Standard crontab has no way to say it, so the builder asks you to choose another scheduler or another day rather than writing something that will not run. On a Linux server, the usual workaround is to run on days 28 to 31 and have the job check whether tomorrow is the 1st.
Which time zone the times are in#
The expression carries no time zone. It runs in whatever zone the scheduler uses, which for GitHub Actions and AWS EventBridge rules is UTC, and for crontab is the server clock unless CRON_TZ is set. The next runs here are shown in UTC for that reason. A job meant for 09:00 in New York has to be written for 13:00 or 14:00 UTC, depending on daylight saving, or scheduled somewhere that lets you set the zone.
Frequently asked questions#
Which kind of cron should I pick?
#
The one the scheduler reads. Standard, with five fields, is for a Linux crontab, GitHub Actions, Kubernetes CronJobs, and most job runners. Quartz is for Java apps using the Quartz scheduler. Spring is for the cron attribute of @Scheduled, which has a seconds field and does not need a ?. AWS EventBridge is for scheduled rules and EventBridge Scheduler, in the cron() form. Pick the wrong one and the scheduler either rejects the expression or reads the fields one place out.
How do I run a cron job every 5 minutes?
#
Choose Minutes and Every 5 minutes. In standard cron that is */5 * * * *, which runs at minutes 0, 5, 10, and so on through 55 of every hour. In Quartz it is 0 0/5 * * * ?, and in AWS cron(0/5 * * * ? *).
How do I run a job on weekdays only?
#
Choose Daily and Weekdays, then the time. At 09:00 that is 0 9 * * 1-5 in standard cron, where 1 is Monday and 5 is Friday. Quartz writes 0 0 9 ? * MON-FRI and AWS cron(0 9 ? * MON-FRI *).
Where does the expression go?
#
In a crontab, run crontab -e and add a line with the expression followed by the command, such as 0 9 * * 1-5 /home/me/backup.sh. In GitHub Actions it goes under on: schedule: as - cron: '0 9 * * 1-5', in quotes, because YAML reads a leading * as something else. A Kubernetes CronJob takes it as spec.schedule, Spring as @Scheduled(cron = "0 0 9 * * MON-FRI"), and AWS as the schedule expression of a rule, cron() and all.
Why is the seconds field always 0?
#
So a Quartz or Spring job fires once, on the minute. A star there would run it every second of that minute, sixty times. If you need a job on a particular second, change the first field by hand, and the cron expression explainer will read it back.
Can I build something the choices do not cover?
#
Start from the closest choice, copy the expression, and edit it. Lists, ranges, and steps can be combined in ways no form covers, such as 0 9-17/2 * * 1-5 for every other hour through the working day. Paste the edited line into the cron expression explainer to check it before it goes into a config file.