Toolpuffin

    Loading...

    Up and down to choose, Enter to open, Esc to close.

    Cron Expressions Explained: The Five Fields, With Examples

    Updated December 2026

    Written by the Toolpuffin team. Tools in this guide are tested in the browser.

    A cron expression tells a scheduler when to run a job. It looks cryptic, but it is five fields in a fixed order. This guide explains each field, the four special characters and the one rule that surprises most people, and links to a generator that explains an expression in plain words.

    Try the tool: Cron Expression Generator

    The five fields

    A classic cron line has five time fields followed by the command to run. The fields are separated by spaces. The manual page of crontab lists the allowed values.

    FieldAllowed values
    Minute0-59
    Hour0-23
    Day of month1-31
    Month1-12, or the first three letters of the name
    Day of week0-7 (0 and 7 are both Sunday), or the first three letters of the name

    Source: crontab(5) manual page

    Stars, lists, ranges and steps

    • A star (*) means every possible value, from first to last.
    • A comma makes a list: 1,15 in the day-of-month field means the 1st and the 15th.
    • A hyphen makes a range: 1-5 in the day-of-week field means Monday to Friday.
    • A slash makes a step: */2 means every second value, and 0-23/2 in the hours field means every other hour.

    The manual page also mentions extensions in some versions of cron, such as the special strings @daily and @hourly. Not every system supports them, so use the five fields if you are not sure.

    Examples you can copy

    ExpressionMeaning
    */5 * * * *Every 5 minutes
    0 * * * *At the start of every hour
    0 9 * * 1-5At 09:00 on weekdays
    30 4 1,15 * 5At 04:30 on the 1st and 15th of the month, plus every Friday
    0 0 1 * *At midnight on the 1st of every month

    Paste any of them into the generator to see the description and the next run times.

    The day-of-month and day-of-week catch

    If you restrict both the day of month and the day of week, which means neither is a star, the job runs when either one matches, not when both match. That is why 30 4 1,15 * 5 runs on the 1st and 15th and on every Friday. If you want only a Friday that falls on the 1st, you have to add a test to the command yourself.

    Time zones and daylight saving time

    A server runs cron in its own time zone, often UTC, so the times you expect may differ from the clock on your wall. The manual page also warns that around the switch to or from daylight saving time, a job can be skipped or run twice, so avoid scheduling important jobs in the hour that changes.

    Common mistakes

    • Writing 5 * * * * and expecting every 5 minutes. That means minute 5 of every hour. Use */5.
    • Forgetting that the hour is 0-23, so 24 does not exist.
    • Mixing up the day of week numbers. 0 and 7 are Sunday, 1 is Monday.
    • Adding a seconds or year field. Classic cron has only five fields.

    More guides