⏰ Cron Expression Tester

Professional cron expression tester for developers and system administrators. Validates cron syntax, calculates next execution times, and provides educational explanations of cron patterns. Perfect for debugging scheduled tasks and learning cron syntax.

Enter a cron expression (5 fields: minute hour day month weekday) or use shortcuts like @daily, @weekly
How many upcoming execution times to display
Include field-by-field breakdown and educational content about cron syntax

Cron Analysis Results:

⏰ CRON EXPRESSION

"0 2 * * 1" → Every Monday at 2:00 AM

Valid expression • Weekly execution pattern

🔍 Expression Breakdown

0
Minute
0-59
2
Hour
0-23
*
Day
1-31
*
Month
1-12
1
Weekday
0-7
✓ Runs at minute 0, hour 2, on Monday (day 1) of every month

🗓️ Next 5 Execution Times

Monday, January 8, 2024
Next execution in 3 days
2:00:00 AM
UTC
Monday, January 15, 2024
Following week
2:00:00 AM
UTC
Monday, January 22, 2024
Week 3
2:00:00 AM
UTC

🎓 Cron Pattern Education

Common Patterns
0 0 * * * → Daily at midnight
0 */2 * * * → Every 2 hours
*/15 * * * * → Every 15 minutes
Special Characters
* = Any value
/ = Step values
- = Range of values

💡 This expression runs weekly maintenance tasks every Monday at 2 AM

How to Use This Cron Expression Tester

How to Use the Cron Expression Tester

  1. Enter Cron Expression: Input a standard 5-field cron expression (minute hour day month weekday) or use shortcuts like @daily, @weekly
  2. Select Run Count: Choose how many upcoming execution times you want to see (3, 5, 10, or 20)
  3. Enable Explanation: Check the box to see detailed breakdown and educational content
  4. Test Expression: Click the button to validate your cron syntax and see next run times

Cron Expression Format:

minute hour day-of-month month day-of-week
  • minute: 0-59
  • hour: 0-23 (24-hour format)
  • day-of-month: 1-31
  • month: 1-12
  • day-of-week: 0-7 (0 and 7 are Sunday)

How It Works

How the Cron Expression Tester Works

1. Expression Parsing

The tool parses your cron expression into its five components: minute, hour, day of month, month, and day of week. It validates each field against the allowed ranges and checks for proper syntax.

2. Next Run Calculation

Using the current date and time, the calculator determines when your cron job will execute next. It processes complex patterns including ranges (1-5), lists (1,3,5), and step values (*/15).

3. Pattern Recognition

The tool recognizes common cron shortcuts like @daily, @weekly, @monthly and converts them to standard format. It also identifies patterns like "every 15 minutes" or "twice daily".

4. Educational Breakdown

When explanation mode is enabled, you get field-by-field analysis, common pattern examples, and best practices for writing maintainable cron expressions.

When You Might Need This

Frequently Asked Questions

What's the difference between day-of-month and day-of-week in cron expressions?

Day-of-month (field 3) specifies calendar dates (1-31), while day-of-week (field 5) specifies weekdays (0-7, where 0=Sunday). When both are specified, the job runs when EITHER condition is met (OR logic), not both. Use * in one field when you only need the other.

How do I create a cron expression that runs every 15 minutes?

Use '*/15 * * * *' where */15 in the minute field means 'every 15 minutes'. The / character creates step values, so */15 gives you 0, 15, 30, 45 minutes of each hour. Other examples: */5 for every 5 minutes, */30 for every 30 minutes.

What are cron shortcuts like @daily and @weekly?

@daily (or @midnight) equals '0 0 * * *' (midnight every day), @weekly equals '0 0 * * 0' (midnight every Sunday), @monthly equals '0 0 1 * *' (midnight on 1st of month), @yearly equals '0 0 1 1 *' (midnight on Jan 1st). These shortcuts are more readable for common patterns.

Why is my cron job not running at the expected time?

Common issues include: timezone differences (cron runs in server's timezone), using 24-hour format (2 PM is hour 14), mixing day-of-month and day-of-week (creates OR condition), or system cron daemon not running. Always test expressions in staging first and check system logs.

Can I use ranges and lists in cron expressions?

Yes! Use ranges with hyphens: '1-5' for Monday through Friday, '9-17' for business hours. Use lists with commas: '1,3,5' for specific days, '0,30' for twice hourly. Combine them: '1-5,0' for weekdays plus Sunday. Example: '0 9-17 * * 1-5' runs hourly during business hours on weekdays.