Cron Expression Explained: Syntax, Examples, Mistakes
Short answer: a standard cron expression has five fields, minute hour day-of-month month day-of-week, and a job runs when the clock matches them all. Paste yours into the Cron Expression Explainer to read it in plain English, see every field expanded and get the next run times before the job ever fires.
The five fields
┌──────── minute (0-59)
│ ┌────── hour (0-23)
│ │ ┌──── day of month (1-31)
│ │ │ ┌── month (1-12 or JAN-DEC)
│ │ │ │ ┌ day of week (0-7 or SUN-SAT, 0 and 7 are Sunday)
* * * * *
Cron runs on Linux, macOS and many hosting platforms. Each field can hold:
| Symbol | Meaning | Example |
|---|---|---|
* |
every value | * * * * * runs every minute |
, |
a list | 1,15 is the 1st and the 15th |
- |
a range | 9-17 is nine to seventeen |
/ |
a step | */15 is every 15 |
Names work too (JAN, MON-FRI), and shortcuts such as @hourly, @daily, @weekly, @monthly and @yearly are understood.
Examples worth memorising
*/5 * * * *: every 5 minutes.*/15 9-17 * * 1-5: every 15 minutes between 09:00 and 17:59, Monday to Friday. The last run of the day is 17:45, not 17:00, because the hour range includes the whole of hour 17.0 9 * * 1-5: at 09:00 on weekdays.0 0 1 * *: at midnight on the first of every month.30 2 * * 0: at 02:30 every Sunday.
The mistakes that cause real outages
1. Steps restart every hour
*/7 * * * * does not mean "every seven minutes from now". It runs at minutes 0, 7, 14, 21, 28, 35, 42, 49 and 56, and then again at minute 0 of the next hour. The gap after minute 56 is only four minutes. Steps that do not divide 60 evenly always give an uneven pattern.
2. Day of month and day of week are an "or"
When you restrict both, standard cron runs the job when either field matches. So 0 0 13 * 5 is not "Friday the 13th". It runs on the 13th of every month and on every Friday. The Linux manual page for crontab(5) describes this behaviour with its own example. If you want a true "Friday the 13th", let the job run daily and test the date inside the script.
3. Time zone
Cron uses the time zone of the machine or service that runs it, and many cloud schedulers use UTC. The explainer shows the next runs in UTC by default. Switch it to your local time only if that really matches the zone the job runs in. If you plan a schedule around a daylight saving change, compare it with the Time Zone Converter first (see time zones and daylight saving). On the cron implementation described in the Linux manual page, a time that is skipped when the clocks jump forward never matches, and a time that happens twice when they go back can run the job twice. Other schedulers behave differently, so check yours.
4. Dates that never happen
0 0 30 2 * is valid cron, and it never runs, because there is no 30 February. The explainer searches about eight years ahead and tells you when it finds nothing. 0 0 29 2 * shows only leap years.
5. A valid schedule is not a working job
The explainer reads the schedule only. The command still needs the correct path and an executable script. The Chmod Calculator helps with permissions (see chmod 755, 644 and 600 explained). For a risky command in a crontab line, see Is this shell command safe?.
How to use the Cron Expression Explainer
- Open the Cron Expression Explainer.
- Paste the five fields, for example
0 9 * * 1-5, or a shortcut such as@daily. - Read the plain-English sentence (for that example, "At 09:00, on Monday through Friday").
- Check the table that expands each field, then the list of next run times. This is the quickest way to catch a step that behaves differently from what you pictured.
- Choose UTC or local time for the run times.
Limits to know
- Only the standard five-field format is supported. Six-field expressions with seconds, and Quartz symbols such as
L,Wand#, are not. If your scheduler uses them (Quartz, Spring and some cloud services do), read its documentation instead. - Systems differ in small ways. Always confirm in the documentation of the scheduler you actually use.
- The tool explains a schedule. It does not run anything or check that the command works.
- Nothing you type is sent to a server.
Frequently asked questions
What does * * * * * mean?
Every minute of every hour of every day.
How do I run a cron job every 15 minutes?
Use */15 * * * *. It fires at minutes 0, 15, 30 and 45 of every hour.
Is Sunday 0 or 7 in cron?
Both work, and so does SUN.
Why did my cron job run on the wrong day? You probably restricted both day of month and day of week. Cron treats that as "either", not "both".
Does cron use UTC? Cron uses the time zone of the machine or service running it. Many cloud schedulers default to UTC, so check where yours runs.
Can I use seconds in a cron expression? Not in standard cron, and not in this tool. Some schedulers add a sixth field for seconds.
Related tools and guides
- Time zone converter and daylight saving
- Time Zone Converter to compare a run time across zones
- Unix Timestamp Converter for times in logs (see Unix timestamp: seconds vs milliseconds)
- Chmod Calculator for script permissions
- Shell Command Risk Explainer for the command a cron line runs