Cron Expression Generator

Build cron expressions visually or parse existing ones. Standard 5-field cron with human-readable explanation.

Cron expression

– – – – –

What is a cron expression?

Cron expressions are scheduling syntax used by the Unix cron daemon (since 1975), and now adopted by virtually every scheduling system: GitHub Actions, GitLab CI, Kubernetes CronJobs, AWS EventBridge, Google Cloud Scheduler, Jenkins, Airflow, and countless other systems. A cron expression is 5 fields specifying minute, hour, day of month, month, and day of week – powerful enough to express almost any recurring schedule but complex enough that experienced developers still mess up. This tool helps you BUILD cron expressions from intuitive UI choices, PARSE existing ones into human language, and provides common presets (every minute, daily, weekly, etc.). Saves hours of trial-and-error.

How to use this tool

  1. Choose mode — Build (create from form inputs) or Parse (decode existing expression).
  2. Set each field — Minute (0-59), Hour (0-23), Day of month (1-31), Month (1-12), Day of week (0-6, Sunday=0).
  3. Use special characters — * (any), , (list), – (range), / (step). Example: */15 = every 15 minutes.
  4. Try presets — Common patterns: every minute, every hour, daily at 9 AM, weekdays at 9, every Sunday, etc.
  5. Read human description — Tool explains your expression in plain English so you know what it’ll do.

Cron syntax

* * * * *
| | | | |
| | | | +-- day of week (0-6, Sun=0)
| | | +---- month (1-12)
| | +------ day of month (1-31)
| +-------- hour (0-23)
+---------- minute (0-59)

Special characters:

  • * any value
  • , list separator: 1,3,5
  • - range: 9-17 (means 9 through 17)
  • / step value: */15 (every 15) or 0/10 (every 10 starting at 0)

Common examples:

  • * * * * * every minute
  • 0 * * * * every hour at minute 0
  • 0 0 * * * daily at midnight
  • 0 9 * * 1-5 weekdays at 9 AM
  • 0 0 1 * * first of month at midnight
  • */15 * * * * every 15 minutes

Examples

  • Daily database backup at 2 AM: 0 2 * * *
  • Weekly Monday morning team report at 9 AM: 0 9 * * 1
  • Every 5 minutes (e.g. health check): */5 * * * *
  • Last Friday of each month at 5 PM: 0 17 * * 5L (some systems)
  • Business hours, every 30 minutes: */30 9-17 * * 1-5
  • Monthly invoice generation, 1st at 6 AM: 0 6 1 * *
  • Quarterly tax reminders (Jan, Apr, Jul, Oct): 0 9 1 1,4,7,10 *

Tips & best practices

  • Test cron expressions with crontab.guru or similar tools before deploying to production
  • Be careful with 0 (zero) vs * (asterisk) – completely different meanings
  • Sunday is BOTH 0 and 7 in most cron implementations – use 0 for safety
  • */5 in minute field means every 5 minutes – not from start. So */5 = 0,5,10,15,20,25,30,35,40,45,50,55
  • GitHub Actions uses UTC timezone – convert from your local time before setting
  • Avoid scheduling jobs at midnight 00:00 – DST transitions can cause issues
  • Stagger frequent jobs – if 10 services all run at 0 * * * *, the server gets a spike
  • Document your cron expressions in code comments – 6 months later you’ll forget what they mean

Limitations & notes

Standard 5-field cron doesn’t support seconds (Quartz format adds 6th field for seconds). Doesn’t support business calendar concepts (last weekday, holidays). Some implementations (Quartz, AWS) support extended syntax: L (last), W (weekday nearest), # (nth occurrence). For complex business schedules, use scheduling libraries instead of raw cron.

Frequently Asked Questions

Why do my cron jobs run at wrong time?

Most common cause: timezone mismatch. Server may be in UTC while you’re thinking in IST. Always check your scheduler’s timezone settings. GitHub Actions, AWS EventBridge default to UTC. Calculate your desired time in UTC before setting.

What’s the difference between day of month and day of week?

Day of month: 1-31 (specific calendar day). Day of week: 0-6 (Mon-Sun). If BOTH are specified, the job runs when EITHER matches (OR not AND). To run only on ‘Monday the 1st’, you can’t express in standard cron – use language-level filtering.

Does cron support seconds?

Standard Unix cron: no, minimum granularity is 1 minute. Quartz scheduler (Java) and some others add seconds field as 6th position. AWS EventBridge supports both formats.

Can I run a job only on weekdays?

Yes. Set day of week to 1-5 (Mon-Fri). Example daily at 9 AM weekdays: 0 9 * * 1-5. Skip weekends automatically.

How do I run a job once a year?

Specify month and day: 0 0 25 12 * runs at midnight Dec 25. For ‘once a year on date X at time Y’, this works. For ‘every X years’, cron can’t directly – use cron once a year and have your script track years.

What’s the * (asterisk) really mean?

Any/every value. 0 * * * * = every hour at minute 0 (so minute=0, hour=anything, day=anything, etc.). It’s a wildcard meaning ‘I don’t care, fire on every value’.

Why is */7 buggy for ‘every 7 days’?

Steps in cron don’t loop. */7 in day of month means 1, 8, 15, 22, 29 – then jumps back to 1 next month (skipping ~4 days from month 30 to next month 1). Not truly every 7 days. For real 7-day intervals, use external scheduling tools that track since-start.

Related tools

Time Zone Converter · Days Between Dates · Age Calculator

Copied to clipboard