Introduction
Cron expressions are the scheduling language of Unix. A string like `0 9 * * 1-5` means "run at 9:00 AM every weekday" and has been triggering jobs on millions of servers since the 1970s. The format is compact but not always obvious, especially when you encounter special characters like L, W, and the hash symbol. This cron parser takes a 5-field expression, produces a human-readable description, breaks down each field, and computes the next five execution times. Type an expression above and the result appears instantly. Nothing is sent to a server.
What this tool does
- Parses standard 5-field cron expressions: minute (0-59), hour (0-23), day-of-month (1-31), month (1-12), day-of-week (0-6, where 0 is Sunday).
- Supports all standard special characters: asterisk (every value), comma (list), hyphen (range), and slash (step values like */15 or 0-59/5).
- Handles Vixie cron extensions: L (last day of month or last weekday), W (nearest weekday to a given day), and # (nth weekday of the month, e.g. 5#3 for the third Friday).
- Generates a plain-English description of the schedule, such as "At 09:00 AM on Monday through Friday" for `0 9 * * 1-5`.
- Computes the next five execution times from the current moment, accounting for all field constraints including L, W, and # expressions.
- Provides preset expressions for common schedules (every minute, daily at midnight, every weekday at 9 AM, every 15 minutes) for quick testing.
How this tool works
Type a cron expression into the input field or select a preset from the dropdown. The tool splits the input on whitespace and expects exactly five fields. Each field is parsed independently against its allowed range.
For each field, the parser handles four cases. An asterisk expands to all values in the range. A comma-separated list parses each item independently. A hyphen range expands to all values between the bounds. A slash step (e.g. `*/15` or `0-59/5`) iterates from the lower bound to the upper bound at the given step. The parser also handles the Vixie cron extensions: `L` for the last day of the month or last weekday, `W` for the nearest weekday to a given day, and `#` for the nth occurrence of a weekday in a month.
After parsing, the tool builds a human-readable description by combining the time, day, month, and weekday parts. It then computes the next five execution times by iterating forward minute by minute from the current time, checking each candidate against all five field constraints. For L, W, and # expressions, it computes the specific target day for each month and checks against that. The settings panel shows the description, the per-field breakdown, and the next five execution times in ISO format.
How cron expressions work
The cron format originated in Version 7 Unix (1979) and was documented in the cron man page. The original implementation by Ken Thompson supported only the five basic fields with asterisk, comma, range, and step. Paul Vixie extended the format in 1987 with the L, W, and # operators, which are now commonly called "Vixie cron" extensions. The POSIX standard defines the base 5-field format but does not include the Vixie extensions, so portability depends on which cron daemon runs on the target system.
The five fields map to time components in order: minute (0-59), hour (0-23), day-of-month (1-31), month (1-12 or names like January), and day-of-week (0-6 or names like Monday, where 0 and 7 both mean Sunday). An asterisk in a field means "every value in the range." A step value after a slash narrows the selection: `*/15` in the minute field means 0, 15, 30, 45.
The L operator has two meanings. In the day-of-month field, `L` means the last day of the month (28, 29, 30, or 31 depending on the month). In the day-of-week field, `5L` means the last Friday of the month. The W operator finds the nearest weekday to a given day: `15W` means the nearest Monday-Friday to the 15th, moving forward to Monday if the 15th is a Saturday or backward to Friday if it is a Sunday. The # operator selects the nth weekday: `5#3` means the third Friday of the month.
A common source of confusion is the interaction between day-of-month and day-of-week. When both fields are restricted (not asterisk), cron runs the job when either condition is met, not both. So `0 0 1 * 1` runs at midnight on the first of the month and also at midnight every Monday. This is an OR relationship, not an AND. For more on scheduling and time-based identifiers, see the Snowflake ID Decoder or the UUID Generator.
How to use this tool
- Type a 5-field cron expression into the input field, or select a preset from the dropdown for common schedules like every 15 minutes or daily at midnight.
- Check the Valid indicator. If the expression has the wrong number of fields or an invalid value for a field, the tool lists the specific errors.
- Read the human-readable description to confirm the schedule matches your intent. For example, `0 9 * * 1-5` produces "At 09:00 AM on Monday through Friday."
- Review the field breakdown to see how each field was parsed, including expanded values for ranges and steps.
- Check the next five execution times to verify the schedule fires when you expect, accounting for the current date and time.
- Experiment with special characters: use `L` for last day of month, `15W` for nearest weekday to the 15th, or `5#3` for the third Friday.
Real-world examples
Scheduling a weekday data pipeline
Input: `30 6 * * 1-5`. The parser reads minute 30, hour 6, day-of-month asterisk, month asterisk, day-of-week 1-5 (Monday through Friday). The description is "At 06:30 AM on Monday through Friday." The next five execution times show the upcoming weekdays at 6:30 AM, skipping weekends. This is a common schedule for ETL jobs that run before business hours on workdays.
Using L for end-of-month reports
Input: `0 17 L * *`. The parser reads minute 0, hour 17, day-of-month L (last day of month), month asterisk, day-of-week asterisk. The description is "At 05:00 PM on the last day of the month." The next execution time computes the last day of the current month (28, 29, 30, or 31 depending on month and leap year) and schedules the job for 17:00 on that day. This avoids hardcoding 31 and having the job skip February and April.
Patching servers on the third Friday
Input: `0 2 15W * *`. The parser reads `15W` as the nearest weekday to the 15th. If the 15th is a Saturday, the job runs on Friday the 14th. If the 15th is a Sunday, the job runs on Monday the 16th. If the 15th is a weekday, the job runs on the 15th. The description is "At 02:00 AM on nearest weekday to day 15." This is useful for maintenance windows that should avoid weekends.
Debugging the day-of-month and day-of-week OR logic
Input: `0 0 1 * 1`. A developer expects this to run only on the first Monday of each month, but the parser description shows "At 12:00 AM on day 1 of the month and on Monday." The job actually runs on the 1st of every month and on every Monday, because cron uses OR logic when both day fields are restricted. To run on the first Monday only, use `0 0 * * 1#1` (the first Monday via the # operator).
Comparison with similar methods
| Method | Complexity | Typical use |
|---|---|---|
| 5-field cron (POSIX) | minute hour day month weekday, basic operators | Standard Unix cron, most Linux distributions |
| Vixie cron extensions | Adds L, W, # operators | Linux cron, Quartz scheduler, Spring @Scheduled |
| 6-field cron (Quartz) | Adds seconds field and year field | Java Quartz scheduler, some cloud platforms |
| Systemd timers | OnCalendar expressions, monotonic timers | Modern Linux systemd-based systems |
| AWS EventBridge cron | 6-field with mandatory year, no L/W/# | AWS scheduled Lambda functions |
Limitations or considerations
This tool implements the 5-field format with Vixie cron extensions (L, W, #). It does not support the 6-field or 7-field formats used by Quartz (which adds a seconds field and optional year field) or AWS EventBridge (which uses a 6-field format with a mandatory year). If you paste a 6-field expression, the tool will report a field count error.
The next-run computation iterates forward minute by minute and caps at one million iterations. For expressions that fire rarely (e.g. `0 0 29 2 *` for February 29th), the computation may hit the iteration limit before finding the next occurrence. In practice this only happens for schedules that fire less than once per year.
Cron expressions do not support timezone specification. The execution times are computed in the browser's local timezone, which is the same behavior as a system cron daemon running on the server. If you need UTC or a specific timezone, convert the expression or run the job in a container configured for that timezone.
The tool does not support month names (January, February) or day names (Monday, Tuesday) in the expression, though some cron implementations do. Use numeric values (1-12 for months, 0-6 for weekdays) instead.
Frequently asked questions
What is the difference between 5-field and 6-field cron expressions?
The standard 5-field format (minute hour day-of-month month day-of-week) is used by Unix cron and most Linux systems. The 6-field format adds a seconds field at the beginning, used by Quartz and some cloud platforms. AWS EventBridge uses a 6-field format with a mandatory year field. This tool only supports the 5-field format.
When both day-of-month and day-of-week are restricted, does cron use AND or OR?
OR. If both fields are restricted (not asterisk), the job runs when either condition is satisfied. So `0 0 1 * 1` runs on the 1st of every month and on every Monday, not only on the first Monday. To run on the first Monday only, use `0 0 * * 1#1` (the # operator for the nth weekday of the month).
What does the L operator do in cron?
In the day-of-month field, `L` means the last day of the month (28, 29, 30, or 31 depending on the month and leap year). In the day-of-week field, `5L` means the last Friday of the month. L is a Vixie cron extension and is not part of the POSIX cron standard, so it may not work on all systems.
What does the W operator do in cron?
The W operator finds the nearest weekday (Monday through Friday) to a given day of the month. `15W` means the nearest weekday to the 15th. If the 15th is a Saturday, the job runs on Friday the 14th. If the 15th is a Sunday, the job runs on Monday the 16th. If the 15th is already a weekday, the job runs on the 15th.
Why does the next-run computation sometimes fail to find a time?
The computation iterates forward minute by minute and caps at one million iterations (about 694 days). For expressions that fire very rarely, such as `0 0 29 2 *` (February 29th at midnight), the next occurrence may be more than a year away and the iteration limit may be reached. In practice, this only happens for schedules that fire less than once per year.
Conclusion
Cron expressions are a compact, decades-old scheduling language that still runs on most servers. The 5-field format with Vixie extensions (L, W, #) covers the vast majority of scheduling needs, from hourly cleanup jobs to monthly reports on the last day. This parser gives you a readable description and the next five execution times so you can verify a schedule before deploying it. For other developer utility tools, see the Snowflake ID Decoder for distributed ID inspection or the UUID Generator for standard identifier generation.