Cron Expression Cheatsheet: Every Syntax You Need
Cron expressions are five (or six) fields that define when a scheduled job runs. Getting the syntax right the first time saves hours of debugging. This cheatsheet covers every field, common patterns, and edge cases — plus a free generator to validate expressions before you deploy.
If you want to skip writing expressions by hand, use Jaconir Cron Job Generator to build and visualize any schedule in seconds.
Cron Expression Field Order
Standard cron uses five fields separated by spaces:
┌─────────── minute (0–59)
│ ┌───────── hour (0–23)
│ │ ┌─────── day of month (1–31)
│ │ │ ┌───── month (1–12 or JAN–DEC)
│ │ │ │ ┌─── day of week (0–6 or SUN–SAT)
│ │ │ │ │
* * * * *
Some platforms (AWS EventBridge, Spring, Quartz) add a seconds field at the start or a year field at the end. Always check your platform's docs.
Special Characters
- * — every value (e.g. every minute, every hour)
- , — list of values (e.g.
1,15,30= minutes 1, 15 and 30) - - — range (e.g.
9-17= hours 9 through 17) - / — step (e.g.
*/15= every 15 units) - L — last (e.g.
Lin day-of-month = last day of the month) - W — nearest weekday (e.g.
15W= nearest weekday to the 15th) - # — nth weekday of month (e.g.
2#1= first Monday)
Common Cron Expression Examples
Every Minute
* * * * *
Every 5 Minutes
*/5 * * * *
Every 15 Minutes
*/15 * * * *
Every 30 Minutes
*/30 * * * *
Every Hour (on the hour)
0 * * * *
Every Hour at 30 Past
30 * * * *
Every Day at Midnight
0 0 * * *
Every Day at 9 AM
0 9 * * *
Every Weekday at 9 AM (Mon–Fri)
0 9 * * 1-5
Every Monday at 8 AM
0 8 * * 1
Every Weekend at Noon
0 12 * * 6,0
First Day of Every Month at Midnight
0 0 1 * *
Last Day of Every Month at 11 PM
0 23 L * *
Every 3 Months (quarterly) on the 1st at Midnight
0 0 1 */3 *
Once a Year — January 1st at Midnight
0 0 1 1 *
Every Hour Between 9 AM and 5 PM on Weekdays
0 9-17 * * 1-5
Platform Differences
- Linux/Unix crontab: standard 5-field format above.
- AWS EventBridge: 6 fields — adds
secondsat the start and uses?for either day-of-month or day-of-week (not both). - Spring / Quartz: 6 or 7 fields — seconds first, optional year last.
- GitHub Actions: standard 5-field but runs in UTC; account for timezone offset.
- Kubernetes CronJob: standard 5-field.
- Vercel / Railway: standard 5-field.
Debugging Tips
- Always test in UTC first. Most cloud schedulers run in UTC. A job at
0 9 * * *fires at 9 AM UTC — work backwards from there to your local timezone. - Avoid day-of-month + day-of-week together. Combining both fields behaves differently across implementations and is a common source of unexpected triggers.
- Use a visualizer before deploying. Running
*/5 * * * *on a heavy job is an easy way to bring down a service at 3 AM. Verify next-run times visually first. - Log the first 3 runs. Confirm actual trigger times match expected times in your timezone before removing debug logging.
FAQ
What does 0 0 * * * mean?
It runs at minute 0 of hour 0 every day — midnight UTC. It is one of the most common schedules for nightly cleanup or report jobs.
How do I run a job every 2 hours?
Use 0 */2 * * * — this fires at minute 0 of every second hour (midnight, 2 AM, 4 AM, etc.).
Can cron run more frequently than every minute?
Not with standard cron syntax. For sub-minute scheduling, use a persistent process with setTimeout / sleep loops, or a queue-based worker.
How do I generate and validate an expression without memorizing syntax?
Use Jaconir Cron Job Generator — pick a schedule visually and it writes the expression and shows the next run times.
Conclusion
Most cron expressions follow a handful of patterns. Once you know the field order and a few special characters, nearly every schedule is writable in seconds. Keep this page bookmarked as a quick reference, and use the generator for anything non-standard.
Build your next schedule: Cron Job Generator →