How to Build Cron Expressions
Cron expressions schedule recurring tasks on Unix systems, CI/CD pipelines, and cloud functions. The five-field syntax (minute, hour, day, month, weekday) is compact but easy to get wrong. This guide helps you build correct cron expressions visually.
Try Crontab Generator Now
Free, no signup. Works in your browser.
Open the Crontab Generator
Navigate to the Crontab Generator in the Debug category. You will see a visual editor with dropdowns for each of the five cron fields plus a preview of upcoming run times.
Set the schedule fields
Use the dropdowns or type directly to set minute (0-59), hour (0-23), day of month (1-31), month (1-12), and day of week (0-6). Use * for 'every', */5 for 'every 5th', and commas for specific values.
Preview next run times
The tool calculates and displays the next 5-10 execution times based on your cron expression. Verify that the schedule matches your intention before deploying.
Use preset templates
Click on common presets like 'every hour', 'daily at midnight', 'weekdays at 9am', or 'first day of month'. These fill in the fields instantly and serve as a starting point for customization.
Copy the cron expression
Copy the final expression (e.g., `0 9 * * 1-5`) along with a human-readable description. Paste it into your crontab file, GitHub Actions workflow, or cloud scheduler configuration.
Pro Tips
- *Remember: cron fields are minute, hour, day-of-month, month, day-of-week — in that order.
- *Use `0 */2 * * *` for every 2 hours, not `*/2 * * * *` (which runs every 2 minutes).
- *For GitHub Actions, use `cron: '30 4 * * *'` with quotes in the YAML schedule trigger.
- *Always set cron jobs to UTC to avoid daylight saving time surprises.
- *Add a comment above each crontab entry explaining what it does — your future self will thank you.
Related Guides
How to Test Regular Expressions Online
Test and debug regex patterns with real-time matching, group highlighting, and a cheat sheet. Supports JavaScript, Python, and Go flavors.
How to Build a Docker Compose File
Generate Docker Compose YAML files with a visual builder. Configure services, volumes, networks, environment variables, and health checks without memorizing the syntax.
How to Convert Unix Timestamps
Convert Unix timestamps to human-readable dates and vice versa. Supports seconds, milliseconds, ISO 8601, RFC 2822, and timezone conversions.