DEVELOPER TOOL

Cron Expression Parser

Parse and visualize cron expressions with human-readable descriptions, field breakdowns, and next execution times. Supports standard 5-field format.

Format: minute hour day-of-month month day-of-week

Mastering Cron Expressions

The Five-Field Format

minute(0-59) hour(0-23) day(1-31) month(1-12) weekday(0-6)

Cron was created by Ken Thompson for Unix Version 7 in 1979. The five-field format has remained virtually unchanged for over 45 years. Each field accepts specific values, ranges (1-5), lists (1,3,5), steps (*/15), and the wildcard (*). The expression 30 8 * * 1-5means “at 8:30 AM, Monday through Friday” — a pattern used millions of times daily for business-hour scheduled tasks across Linux servers worldwide.

Step Values and Ranges

The step operator (/) is the most powerful cron feature. */5in the minute field means “every 5 minutes” (0, 5, 10, ... 55). But steps can start from any value: 3/10means “starting at minute 3, every 10 minutes” (3, 13, 23, 33, 43, 53). Ranges with steps are equally useful: 9-17/2in the hour field means “every 2 hours from 9 AM to 5 PM” (9, 11, 13, 15, 17). These operators compose with lists via comma separation, enabling expressions like 0,30 9-17 * * 1-5 (every 30 minutes during business hours on weekdays).

Common Pitfalls

Day-of-month + Day-of-week: When both fields are set (not *), most cron implementations run the job when either condition is met, not both. So 0 0 13 * 5 fires on every 13th and every Friday, not just Friday the 13th. Timezone confusion:Cron jobs run in the server's timezone. A job scheduled at 0 0 * * * fires at midnight server time, which might be noon in another timezone. DST gaps: A 2:30 AM job may not fire during spring-forward, or fire twice during fall-back.

Beyond Classic Cron

Modern systems extend the classic 5-field format. Kubernetes CronJobs and GitHub Actions use standard 5-field cron. AWS EventBridge adds a 6th field (year) and supports L (last day), W (nearest weekday), and # (nth weekday). Spring Boot's @Scheduled uses a 6-field format with seconds as the first field. Node.js libraries like node-cron support both 5 and 6 fields. Always check which cron dialect your platform uses before pasting an expression.

Frequently Asked Questions

What is the difference between */5 and 0/5 in the minute field?

They produce the same result: 0, 5, 10, 15, ..., 55. The * in */5 means “the entire range (0-59)” and /5 steps through it. 0/5 explicitly starts at 0. However, 3/5 starts at 3: 3, 8, 13, 18, ..., 58. Use explicit start values when you need an offset from the default.

How do I schedule a job to run on the last day of every month?

Standard cron has no “last day” syntax. The common workaround is to run a script at the end of each day that checks if tomorrow is the 1st: 55 23 28-31 * * [ $(date -d +1day +%d) -eq 01 ] && your-command. Alternatively, platforms like AWS EventBridge support the L flag natively: 0 0 L * ? *.

Is day-of-week 0 Sunday or Monday?

In standard Unix cron, 0 = Sunday and 7 is also Sunday (for convenience). Monday is 1. Some implementations (notably Quartz Scheduler used in Java) use 1 = Sunday, 2 = Monday. This tool uses the standard Unix convention where 0 = Sunday.