Like ToolFern? Prefer us as your source on Google →

Cron Expression Generator

Build a cron expression without guessing. Pick a common schedule or set the five fields yourself, then copy the string, read a plain English explanation and check the next five run times before it goes anywhere near a crontab.

You can also paste a cron expression here, the 5 fields above update to match.

In plain English

Runs every minute.

Next 5 run times

    Format: minute hour day-of-month month day-of-week. Use * for every value, 1-5 for a range, 1,3,5 for a list and */15 for steps. Run times use your local time.

    How to use this cron generator

    1. Pick a schedule from the Common schedules menu to fill all five fields in one go, or set each field yourself.
    2. Edit the fields: minute, hour, day of month, month, day of week.
    3. Read the plain English line and the next five run times. Both update as you type, so a wrong field shows up straight away.
    4. Already have an expression? Paste it into the cron expression box. The five fields, the explanation and the run times all fill in to match.

    The run times are worked out in your browser from your own clock and time zone. Your server is probably on UTC, so treat the preview as a check on the pattern rather than on the wall clock time the job will fire.

    How cron expressions work

    Five fields separated by spaces, in this order: minute hour day-of-month month day-of-week. A job runs when the clock matches every field at once.

    Those ranges come straight from thePOSIX crontab spec. Each field takes the same four kinds of value:

    That is enough for most schedules. 0 9 * * 1 is 09:00 every Monday. */15 9-17 * * 1-5 is every quarter of an hour through the working day on weekdays, which comes to 36 runs per weekday.

    The day rule that catches everyone

    Set day of month and day of week to anything other than a star and cron joins them with OR, not AND.

    So 0 0 13 * 5 is not Friday the 13th. It fires at midnight on the 13th of every month and at midnight every Friday, roughly 63 times a year instead of the once or twice you had in mind. Leave one of the two fields as a star and the ambiguity goes away.

    Amazon EventBridgetakes a harder line on the same problem. Its six field format bans a star in both day fields and makes you write? in whichever one you are not using, so the reader always knows which field is in charge.

    What cron does when the clocks change

    Clock changes are where schedules quietly break. Debian and Ubuntu cron has adocumented rulefor shifts of under three hours, which covers every daylight saving change. Jump forward, and jobs that would have run inside the missing hour are run soon after the shift rather than skipped. Go back, and jobs that land in the repeated hour run once, not twice. There is a catch. That protection applies only to jobs pinned to a particular time, so anything carrying a star in the hour or minute field, or a shortcut such as @hourly, simply follows the new time and can genuinely fire twice or not at all. In practice 0 2 * * * survives both transitions untouched, while */30 * * * * hands you two 01:30 runs on the night the clocks go back.

    The percent sign that eats your command

    An expression is only half a crontab line. The other half is the command, and POSIX says a % in the command is translated to a newline, with everything after the first one fed to the job as standard input.

    That is why date +%F works fine in a terminal and quietly truncates a cron job. Escape each one as\%F, or move the whole thing into a shell script and call that instead.

    What this generator accepts

    Frequently asked questions

    What is a cron expression?

    Five fields that tell a scheduler when to run a job: minute, hour, day of month, month and day of week. 0 9 * * 1 means 09:00 every Monday.

    What does an asterisk mean in cron?

    It matches every value in that field. * * * * * runs once a minute, because all five fields match everything, which works out at 1,440 runs a day.

    How do step values like */15 work?

    The number after the slash is the interval, counted from the start of the field. */15 in the minute field fires at 0, 15, 30 and 45. Steps work on a range as well: 0-30/10 gives 0, 10, 20 and 30, then stops.

    Why does 0 0 13 * 5 run more often than I expect?

    Because cron joins the two day fields with OR when neither is a star. That expression fires at midnight on the 13th of every month and at midnight every Friday, about 63 times a year. To get Friday the 13th and nothing else, schedule it for the 13th and put the weekday test inside the script the job calls.

    Can I write MON or JAN instead of numbers?

    Not in this generator. It parses digits plus star, dash, comma and slash, so 0 9 * * MON comes back as an error and you want 0 9 * * 1 instead. Most Linux cron builds do accept the three letter names, but numbers are read the same way everywhere, so they are the safer thing to commit.

    Does a cron job run twice when the clocks go back?

    It depends on the expression. A job pinned to a fixed time, such as 30 1 * * *, is run once by Debian and Ubuntu cron even though 01:30 comes round twice. A job with a star in the hour or minute field gets no such protection and runs on both passes through the repeated hour.

    Found this useful? Share it