Cron Special Characters
Complete reference for all special characters used in cron expressions.
Quick Reference: Special characters allow you to create complex scheduling patterns beyond simple numeric values.
Basic Special Characters
* Asterisk (Wildcard)
Matches any value in the field. Used when you don't want to restrict that time unit.
, Comma (List Separator)
Allows you to specify multiple values for a field. Separates individual values or ranges.
- Hyphen (Range)
Specifies a range of values (inclusive). Both start and end values are included.
Advanced Special Characters
Note: These advanced characters are supported by some cron implementations (like Quartz) but not standard Unix cron.
L Last (Day of Month/Week)
In day-of-month field: Last day of the month.
In day-of-week field: Last occurrence of that day in the month.
Examples:
0 0 L * * → Last day of every month0 0 * * 5L → Last Friday of every month
W Weekday (Nearest)
Finds the weekday (Monday-Friday) nearest to the given day.
Examples:
0 0 15W * * → Weekday nearest to 15th of month0 0 LW * * → Last weekday of month
# Nth Occurrence
Specifies the Nth occurrence of a weekday in the month.
Examples:
0 0 * * 1#1 → First Monday of month0 0 * * 5#3 → Third Friday of monthCombination Examples
Complex Business Hours
*/30 9-17 * * 1-5
Every 30 minutes during business hours (9 AM - 5 PM), weekdays only
Multiple Time Slots
0 9,12,15,18 * * *
At 9 AM, 12 PM, 3 PM, and 6 PM every day
Weekend + Weekday Pattern
0 8 * * 1-5 + 0 10 * * 0,6
8 AM on weekdays, 10 AM on weekends (requires two separate cron jobs)
Common Mistakes
❌ Mixing AND/OR Logic
0 0 15 * 1 ← This means "15th of month OR Monday"
Day-of-month and day-of-week are OR'ed, not AND'ed!
❌ Invalid Step Values
*/0 * * * * ← Invalid (division by zero)
Step value must be greater than 0
❌ Range Confusion
0 17-9 * * * ← This doesn't work as expected
Ranges can't wrap around. Use two separate entries.
🎯 Master Cron Expressions
Ready to put these special characters to work? Try our visual generator: