Cron Expressions Made Simple: Schedule Anything in 5 Fields
Cron syntax is terse but powerful. Here's how each of the five fields works, with practical examples covering the most common scheduling patterns.
DevPulse Team
Cron is the standard scheduling system on Unix-based systems, and its expression syntax is used everywhere: Linux crontabs, GitHub Actions, AWS CloudWatch, Kubernetes CronJobs, and dozens of job scheduling libraries. Five fields, space-separated. Once you understand the pattern, any schedule is readable at a glance.
The Five Fields
┌───────────── minute (0–59)
│ ┌───────────── hour (0–23)
│ │ ┌───────────── day of month (1–31)
│ │ │ ┌───────────── month (1–12)
│ │ │ │ ┌───────────── day of week (0–6, Sunday=0)
│ │ │ │ │
* * * * *
Each field can be a specific value, a range, a list, a step, or a wildcard. The combinations give you fine-grained control over any recurring schedule.
Special Characters
*— every value in this field ("any minute", "any hour"),— a list of values:1,15,30means at minutes 1, 15, and 30-— a range:9-17in the hour field means 9am through 5pm/— a step:*/15in the minute field means every 15 minutes;2/6means starting at 2, every 6 steps
Common Patterns with Examples
These cover probably 90% of real-world scheduling needs:
# Every minute
* * * * *
# Every hour, on the hour
0 * * * *
# Every day at 2:30am
30 2 * * *
# Every Monday at 9am
0 9 * * 1
# Weekdays at 8am (Monday–Friday)
0 8 * * 1-5
# Every 15 minutes
*/15 * * * *
# First day of every month at midnight
0 0 1 * *
# Every 6 hours
0 */6 * * *
# Twice a day, 8am and 8pm
0 8,20 * * *
Common Mistakes
Day of week vs day of month: If you specify both a day of week and a day of month, cron runs when either condition is true — not both. This surprises people. 0 0 1 * 1 runs on the 1st of every month AND every Monday, not only on Mondays that fall on the 1st.
Time zones: System cron runs in the system timezone. Managed services like AWS EventBridge and GitHub Actions default to UTC. Always check which timezone your scheduler is using, and document it in comments.
Minute zero: * 2 * * * doesn't mean "at 2am" — it means "every minute during the 2am hour". The correct "at 2am" expression is 0 2 * * *.
Testing Before Deploying
Before deploying a cron schedule to production, verify it by running it through a parser that shows you the next several execution times. A typo in a cron expression can mean a job runs every minute instead of every hour, or not at all.
Our Cron Expression Parser explains each field in plain English and shows you the next 5 scheduled run times. Paste any expression and verify it before it goes live.
Free developer tools, right in your browser.
No sign-up. No tracking. 30+ utilities for developers.
Explore DevPulse Tools →Related Articles
YAML vs JSON: When to Use Each and How to Format Both
YAML and JSON solve the same problem — structured data — but in very different ways. Here's when each is the right choice and the syntax pitfalls to avoid.
Developer ToolsURL Encoding Explained: %20, %3A, and Why They Exist
URL encoding converts unsafe characters into percent-encoded equivalents. Here's which characters get encoded, why, and the common developer mistakes.
Developer ToolsCSS Minification: What Gets Removed and Why It Matters
CSS minification removes whitespace, comments, and redundant syntax to reduce file size. Here's what's actually happening under the hood and the gains you can expect.