How to Parse Cron Expressions
Cron expressions are the standard way to define recurring schedules in Unix, CI/CD pipelines, cloud functions, and task schedulers. While the syntax is compact and powerful, it can be hard to read at a glance. This guide explains the five-field format, common operators, and how to verify your schedules before deploying.
When You Need to Parse Cron
- Debugging a CI/CD pipeline that fires at the wrong time
- Setting up scheduled cloud functions (AWS Lambda, Google Cloud Functions)
- Reviewing crontab entries on a server
- Configuring Kubernetes CronJobs
- Understanding someone else's scheduling configuration
Understanding the Five Fields
A standard cron expression consists of five fields separated by spaces:
┌───────────── minute (0-59)
│ ┌─────────── hour (0-23)
│ │ ┌───────── day of month (1-31)
│ │ │ ┌─────── month (1-12)
│ │ │ │ ┌───── day of week (0-6, 0=Sunday)
│ │ │ │ │
* * * * *Step 1: Learn the Operators
Each field supports four operators:
*— matches every value in the range,— lists multiple values (e.g.,1,15)-— defines a range (e.g.,1-5for Mon–Fri)/— defines a step (e.g.,*/10for every 10 units)
Step 2: Read the Expression Left to Right
Start with the minute field and work your way right. For example, 30 9 * * 1-5 reads as: “at minute 30, hour 9, any day of month, any month, Monday through Friday” — which means 9:30 AM on weekdays.
Step 3: Verify with Next Execution Times
The best way to confirm your interpretation is to see the actual upcoming execution times. Open the Cron Expression Parser and paste your expression to see the next 5–25 scheduled runs.
Common Cron Patterns
* * * * *— every minute*/5 * * * *— every 5 minutes0 * * * *— every hour (at minute 0)0 0 * * *— every day at midnight0 9 * * 1-5— weekdays at 9:00 AM0 0 1 * *— first day of every month at midnight0 0 * * 0— every Sunday at midnight
Tips
- Always preview your cron schedule before deploying — a misplaced field can trigger jobs every minute instead of every month
- Remember that day of week 0 is Sunday in standard cron (some systems use 7 for Sunday as well)
- When both day-of-month and day-of-week are set, most implementations treat them as OR (either condition triggers), not AND
- Use the Unix Timestamp Converter alongside cron debugging to verify timezone-sensitive schedules
FAQ
What is a cron expression?
A cron expression is a string of five (or six) fields separated by spaces that defines a recurring schedule. The fields represent minute, hour, day of month, month, and day of week. Cron is used by Unix-like systems, CI/CD platforms, and task schedulers to automate recurring jobs.
What is the difference between 5-field and 6-field cron?
Standard cron uses 5 fields: minute, hour, day, month, and weekday. Some systems (like Spring and Quartz) add a sixth field for seconds at the beginning. Our parser supports both formats automatically.
How do I schedule a job to run every weekday?
Use 1-5 in the weekday field (the fifth field). For example, '0 9 * * 1-5' runs at 9:00 AM every Monday through Friday.
Can I use names instead of numbers for months and weekdays?
Some cron implementations support three-letter abbreviations like JAN-DEC and SUN-SAT. Our parser uses numeric values (0-6 for weekdays, 1-12 for months) for maximum compatibility across platforms.
Try It Now
Ready to parse your cron expression? Open the Cron Expression Parser — it works entirely in your browser with no sign-up required.