Skip to content

Cron Expression Generator

Type a value into each of the five crontab fields and get the assembled expression, a field-by-field description in English and a complete crontab line.

Runs in your browserFree, no sign-upLast reviewed

Settings

Results update automatically as you type.

Cron expression

0 2 * * *

In plain English. Runs at minute 0, hour 2.

Crontab line

0 2 * * * /usr/bin/env bash /path/to/script.sh >> /var/log/job.log 2>&1

Field reference

PositionFieldAllowed valuesYour value
1Minute0-590
2Hour0-232
3Day of month1-31*
4Month1-12*
5Day of week0-6 (Sunday = 0)*

Quick answers

What is the cron expression for every 5 minutes?
Use */5 * * * * to run a job every 5 minutes. The */5 in the minute field means every fifth minute starting from 0, so the job runs at :00, :05, :10 and so on through :55 of every hour, every day.
What is the cron expression for every day at midnight?
Use 0 0 * * * to run a job every day at midnight. Minute 0 and hour 0 fix the time at 00:00, and the three asterisks leave day of month, month and day of week unrestricted, so it runs once every day.
What do the five fields in a cron expression mean?
In order: minute (0-59), hour (0-23), day of month (1-31), month (1-12) and day of week (0-6, where 0 is Sunday). A job runs when the current time matches every field, except that when both day fields are restricted, matching either one is enough.
How do I run a cron job on weekdays only?
Put 1-5 in the day of week field. For example, 0 9 * * 1-5 runs at 09:00 Monday to Friday. Leave day of month as * so the two day fields do not combine unexpectedly.
What does an asterisk mean in cron?
Every allowed value for that field. An asterisk in the hour field means every hour, and * * * * * means every minute of every day. An asterisk followed by a slash and a number, such as */15, means every fifteenth value.
What is the cron expression for every hour?
Use 0 * * * * to run a job at minute 0 of every hour. Writing * * * * * instead would run the job every minute, which is a common mistake: the minute field has to be a fixed number for an hourly job.

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.

ScheduleCron expressionWhen 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 hour0 * * * *On the hour, 24 times a day
Every 2 hours0 */2 * * *00:00, 02:00, 04:00 ... 22:00
Every 6 hours0 */6 * * *00:00, 06:00, 12:00, 18:00
Every day at midnight0 0 * * *00:00 daily
Every day at 2 am0 2 * * *02:00 daily
Every day at 8:30 am30 8 * * *08:30 daily
Twice a day0 9,17 * * *09:00 and 17:00 daily
Weekdays at 9 am0 9 * * 1-509:00 Monday to Friday
Weekday evenings0 22 * * 1-522:00 Monday to Friday
Every Sunday0 0 * * 000:00 on Sunday
Every Monday0 0 * * 100:00 on Monday
Weekends0 0 * * 6,000:00 on Saturday and Sunday
First day of every month0 0 1 * *00:00 on the 1st
1st and 15th of the month0 0 1,15 * *00:00 on the 1st and the 15th
Every quarter0 0 1 */3 *00:00 on 1 January, April, July and October
Once a year0 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

PositionFieldAllowed valuesNotes
1Minute0-59A fixed number here is what makes a job hourly or daily instead of every minute
2Hour0-2324-hour clock; 0 is midnight, 13 is 1 pm
3Day of month1-31Days that do not exist in a month, such as 31 in April, are skipped
4Month1-121 is January. Cron itself also accepts JAN to DEC, but this tool takes numbers only
5Day of week0-60 is Sunday, 6 is Saturday. Most cron versions also read 7 as Sunday

Special characters: asterisk, comma, hyphen and slash

CharacterNameMeaningExample
*AsteriskEvery value in the field* in Hour: every hour
,ListEach of the values named0,30 in Minute: on the hour and half past
-RangeEvery value from the first to the last, inclusive9-17 in Hour: 09:00 through 17:00
/StepEvery 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. 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. 2

    Enter Hour in 24-hour time, 0 to 23, or * for every hour.

  3. 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. 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. 5

    Copy Cron expression on its own, or copy Crontab line and replace /path/to/script.sh and the log path with yours.

Questions people ask

Where do I paste the crontab line?
Run crontab -e on the server to open your user's crontab in an editor, paste the line on its own row, save and exit. crontab -l lists what is installed. Replace /path/to/script.sh with the absolute path to your script first.
Why does the crontab line end with >> /var/log/job.log 2>&1?
It appends the job's normal output to a log file and sends error output to the same place. Without a redirect, cron tries to mail the output of every run to the account that owns the crontab.
Which timezone does cron use?
System cron uses the server's local timezone. Many cloud schedulers and CI services default to UTC. Confirm the timezone before relying on a specific hour, especially around daylight saving changes, when a local-time job can be skipped or run twice.
Can cron run a job every 45 minutes or every 90 minutes?
Not with one expression. Steps restart every hour, so */45 runs at :00 and :45, then again at :00 fifteen minutes later. Intervals that do not divide evenly into 60 minutes or 24 hours need several crontab lines or a check inside the script.
Can cron run a job every second or every 30 seconds?
No. The smallest unit in the five-field format is one minute. Schedulers that use a six-field format add a seconds field at the front; for standard cron, the usual workaround is a loop or a sleep inside the script.
How do I run a job on the last day of the month?
Standard cron has no symbol for it. Common approaches are to schedule the job for days 28-31 and have the script exit unless tomorrow is the 1st, or to run it on the 1st at 00:00 instead. The L character that means last day exists only in Quartz-style formats.
What is the difference between a 5-field and a 6-field cron expression?
Five fields is the Unix crontab format: minute, hour, day of month, month, day of week. Six-field formats, used by Quartz and Spring, put seconds first. Pasting a five-field expression into a six-field scheduler shifts every value one position, so check which format your platform expects.
Why did my cron job not run?
The usual causes are a relative path (cron starts with a minimal environment and a short PATH), a script without execute permission, a timezone different from the one you assumed, or a percent sign in the command, which crontab treats as a line break unless escaped with a backslash.

Looking for something else? Browse all developer tools or see every tool.