How Cron Expression Generator works
A standard cron expression is five fields separated by spaces: minute, hour, day of month, month and day of week. An asterisk means every value, so 0 2 * * * runs at 02:00 every day and */5 * * * * runs every five minutes. This generator joins your five values into one expression, describes each field in words, shows a full crontab line with output sent to a log file, and lists the allowed range for each position beside what you typed. It builds the Unix five-field format used by crontab, Kubernetes CronJobs and GitHub Actions. It does not build six- or seven-field Quartz expressions.
Cron expression examples for common schedules
Each expression below uses only numbers and the four standard symbols, so it can be typed straight into the five fields above.
| Schedule | Cron expression | When it runs |
|---|---|---|
| Every minute | * * * * * | Every minute of every day |
| Every 5 minutes | */5 * * * * | :00, :05, :10 ... :55 of every hour |
| Every 10 minutes | */10 * * * * | :00, :10, :20, :30, :40, :50 |
| Every 15 minutes | */15 * * * * | :00, :15, :30, :45 |
| Every 30 minutes | */30 * * * * | :00 and :30 |
| Every hour | 0 * * * * | On the hour, 24 times a day |
| Every 2 hours | 0 */2 * * * | 00:00, 02:00, 04:00 ... 22:00 |
| Every 6 hours | 0 */6 * * * | 00:00, 06:00, 12:00, 18:00 |
| Every day at midnight | 0 0 * * * | 00:00 daily |
| Every day at 2 am | 0 2 * * * | 02:00 daily |
| Every day at 8:30 am | 30 8 * * * | 08:30 daily |
| Twice a day | 0 9,17 * * * | 09:00 and 17:00 daily |
| Weekdays at 9 am | 0 9 * * 1-5 | 09:00 Monday to Friday |
| Weekday evenings | 0 22 * * 1-5 | 22:00 Monday to Friday |
| Every Sunday | 0 0 * * 0 | 00:00 on Sunday |
| Every Monday | 0 0 * * 1 | 00:00 on Monday |
| Weekends | 0 0 * * 6,0 | 00:00 on Saturday and Sunday |
| First day of every month | 0 0 1 * * | 00:00 on the 1st |
| 1st and 15th of the month | 0 0 1,15 * * | 00:00 on the 1st and the 15th |
| Every quarter | 0 0 1 */3 * | 00:00 on 1 January, April, July and October |
| Once a year | 0 0 1 1 * | 00:00 on 1 January |
Times are in whatever timezone the scheduler uses. System cron uses the server's local time; many hosted schedulers use UTC.
Crontab syntax: the five fields and their allowed values
| Position | Field | Allowed values | Notes |
|---|---|---|---|
| 1 | Minute | 0-59 | A fixed number here is what makes a job hourly or daily instead of every minute |
| 2 | Hour | 0-23 | 24-hour clock; 0 is midnight, 13 is 1 pm |
| 3 | Day of month | 1-31 | Days that do not exist in a month, such as 31 in April, are skipped |
| 4 | Month | 1-12 | 1 is January. Cron itself also accepts JAN to DEC, but this tool takes numbers only |
| 5 | Day of week | 0-6 | 0 is Sunday, 6 is Saturday. Most cron versions also read 7 as Sunday |
Special characters: asterisk, comma, hyphen and slash
| Character | Name | Meaning | Example |
|---|---|---|---|
| * | Asterisk | Every value in the field | * in Hour: every hour |
| , | List | Each of the values named | 0,30 in Minute: on the hour and half past |
| - | Range | Every value from the first to the last, inclusive | 9-17 in Hour: 09:00 through 17:00 |
| / | Step | Every Nth value across the range before the slash | */15 in Minute: 0, 15, 30, 45 |
A step restarts at the beginning of each range. */7 in the minute field runs at 0, 7, 14 ... 56 and then at 0 again, so the last gap in each hour is 4 minutes, not 7.
What the generator returns for four inputs
Values typed into Minute, Hour, Day of month, Month and Day of week, with the exact text shown under Cron expression and In plain English.
Nightly job (the defaults)
Minute 0, Hour 2, Day of month *, Month *, Day of week *
0 2 * * * with the read-back: Runs at minute 0, hour 2.
Crontab line: 0 2 * * * /usr/bin/env bash /path/to/script.sh >> /var/log/job.log 2>&1
Polling every five minutes
Minute */5, Hour *, Day of month *, Month *, Day of week *
*/5 * * * * with the read-back: Runs at every 5 minutes, every hour.
Weekly maintenance on Sunday at 4 am
Minute 0, Hour 4, Day of month *, Month *, Day of week 0
0 4 * * 0 with the read-back: Runs at minute 0, hour 4, on Sunday.
Annual job on New Year's Day
Minute 0, Hour 0, Day of month 1, Month 1, Day of week *
0 0 1 1 * with the read-back: Runs at minute 0, hour 0, on day of the month 1, in January.
Day of month and day of week together: the OR rule
Cron normally requires every field to match. The two day fields are the exception. When both day of month and day of week are restricted, meaning neither is an asterisk, standard cron runs the job when either one matches.
So 0 0 13 * 5 does not mean Friday the 13th. It means midnight on the 13th of every month and also midnight every Friday. The behaviour is described in the crontab manual page and is intentional, but it is easy to miss.
The safe habit is to restrict only one of the two and leave the other as an asterisk. If a job really must run only when a date and a weekday coincide, schedule it on the date and test the weekday inside the script.
Limits of this generator
Check these before relying on the output for a production schedule.
- Values are not range-checked. The tool rejects letters and unknown symbols, but it accepts a number outside the allowed range, such as 99 in Minute, so compare your entries with the Field reference table.
- Names are not accepted. Use 1 instead of MON or JAN. Shortcuts such as @daily and @reboot are also rejected.
- Quartz and AWS characters (?, L, W, #) and a seconds or year field are not supported. Those belong to six- and seven-field formats.
- The English read-back describes one field at a time and is literal. A single weekday or month number is turned into its name, but lists and ranges are repeated as numbers: 1-5 in Day of week reads back as day of the weeks 1 through 5, not Monday to Friday.
- It does not calculate upcoming run times, so confirm the first few runs in your scheduler or its logs.
- An empty field is treated as an asterisk.
Step by step
- 1
Enter Minute: a number from 0 to 59, a list such as 0,30, a range such as 0-15, a step such as */5, or * for every minute.
- 2
Enter Hour in 24-hour time, 0 to 23, or * for every hour.
- 3
Set Day of month (1-31), Month (1-12) and Day of week (0-6, Sunday is 0). Leave * in any field that should not restrict the schedule.
- 4
Check the line under In plain English against what you meant, and compare each value with the Allowed values column in Field reference.
- 5
Copy Cron expression on its own, or copy Crontab line and replace /path/to/script.sh and the log path with yours.