🧰 ToolPilot

Cron Expression Generator

Build and parse cron schedules visually. Set each field or choose a preset to generate a cron expression. See the human-readable description and next execution times instantly.

Common Presets

Cron Expression
0 9 * * *
At 09:00 AM

Next 5 Execution Times

  • 5/1/2026, 9:00:00 AM
  • 5/2/2026, 9:00:00 AM
  • 5/3/2026, 9:00:00 AM
  • 5/4/2026, 9:00:00 AM
  • 5/5/2026, 9:00:00 AM

Cron Field Reference

FieldValuesSpecial
Minute0-59* , - /
Hour0-23* , - /
Day of Month1-31* , - /
Month1-12* , - /
Day of Week0-6 (Sun=0)* , - /

What Is a Cron Expression?

A cron expression is a compact string that defines a recurring schedule for automated task execution. Originally developed for the Unix cron daemon in the 1970s, cron expressions have become the universal standard for scheduling across operating systems, cloud platforms, and CI/CD tools. The name comes from the Greek word "chronos" (time).

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), and day of week (0-6, where 0 is Sunday). Each field can contain a specific value, a wildcard (*) meaning "every," a range (1-5), a list (1,3,5), or a step value (*/15 meaning "every 15 units"). These five fields combine to express virtually any recurring schedule, from "every minute" to "at 3:30 AM on the first Monday of March and September."

Some platforms extend the standard with a sixth field for seconds (placing it before the minute field) or support special keywords like @daily, @weekly, and @monthly. This generator produces the standard 5-field format, which is compatible with crontab, AWS EventBridge, Kubernetes CronJobs, GitHub Actions, and most other scheduling systems.

How Cron Expressions Work

The cron daemon checks every minute whether the current time matches any scheduled expression. For a match to occur, all five fields must simultaneously match the current minute, hour, day of month, month, and day of week. If they all match, the associated command executes.

Special characters extend the flexibility of each field. The asterisk (*) matches every possible value in the field. A hyphen (-) defines an inclusive range, so 9-17 in the hour field means every hour from 9 AM to 5 PM. A comma (,) separates individual values, so 1,3,5 in the day-of-week field means Monday, Wednesday, and Friday. The slash (/) defines step intervals, so */10 in the minute field means every 10 minutes (0, 10, 20, 30, 40, 50).

An important subtlety: the day-of-month and day-of-week fields interact as a logical OR, not AND. The expression 0 9 15 * 1 runs at 9 AM on the 15th of every month AND every Monday, not only on Mondays that fall on the 15th. This is a common source of confusion when building schedules.

Common Use Cases

  • Database backups: Schedule nightly backups with 0 2 * * * (every day at 2:00 AM) to run during off-peak hours when database load is lowest.
  • Log rotation and cleanup: Use 0 0 * * 0 (every Sunday at midnight) to rotate log files, compress old logs, and delete archives older than a retention period.
  • CI/CD scheduled builds: Trigger nightly builds or dependency update checks with GitHub Actions or GitLab CI using expressions like 0 6 * * 1-5 (weekdays at 6 AM).
  • Kubernetes CronJobs: Run batch processing, report generation, or data synchronization in your cluster on a schedule. Kubernetes uses standard 5-field cron syntax in its CronJob resource definition.
  • Email and notification digests: Send daily or weekly summary emails using 0 9 * * 1 (Monday at 9 AM) for weekly digests or 0 8 * * * for daily reports.
  • Cache invalidation: Clear and rebuild caches periodically with */30 * * * * (every 30 minutes) to keep data fresh without manual intervention.
  • Health checks and monitoring: Run heartbeat checks or system health scripts every few minutes with */5 * * * * to catch issues before users notice.
  • AWS Lambda and EventBridge schedules: Trigger serverless functions on a schedule for tasks like processing queues, generating reports, or syncing data between services.

Tips and Best Practices

  • Always verify with next execution times: Before deploying a cron expression, check the next 5-10 execution times to confirm it matches your intent. This tool calculates them automatically.
  • Avoid scheduling everything at midnight: Many teams default to 0 0 * * *. Staggering jobs (e.g., 0 1, 0 2, 0 3) reduces resource contention and makes logs easier to read.
  • Use descriptive comments: In crontab files, add a comment above each expression explaining what the job does and who owns it. This saves time when debugging months later.
  • Account for time zones:Cron typically runs in the system's local time zone. If your servers are in UTC but your users expect jobs at 9 AM EST, you need to schedule at 14:00 UTC. Kubernetes CronJobs use UTC by default.
  • Handle overlap carefully: If a job takes longer than the interval between runs, you could end up with overlapping executions. Use lock files, flock, or Kubernetes concurrencyPolicy to prevent this.
  • Test with short intervals first: When deploying a new cron job, use a high-frequency schedule (every minute) to verify it works, then switch to the actual production schedule.

Cron Expression Generator vs Manual Writing

Writing cron expressions by hand is error-prone because the field order is not intuitive and the special characters interact in non-obvious ways. A visual generator eliminates syntax errors by letting you set each field independently and see the resulting schedule in plain language. You also get instant feedback through the next execution times, which is impossible to calculate mentally for complex expressions.

Compared to online cron generators that require a network connection, this tool runs entirely in your browser. There is no server involved, which means you can use it on air-gapped networks, behind corporate firewalls, or without an internet connection. The expression you build here works in crontab, AWS EventBridge, Kubernetes, GitHub Actions, Jenkins, and any other platform that accepts standard 5-field cron syntax.

Frequently Asked Questions

Related Tools