Date-Named File to YYYY-MM-DD Renamer
Batch rename files with dates in their names to standardized YYYY-MM-DD format. Drag and drop files, preview changes, and download renamed copies.
About
Files named with inconsistent date formats - March 15, 2024, 15-03-2024, 03.15.2024 - create sorting chaos. Alphabetical ordering breaks. Search fails. Backups become unreliable. This tool parses over 15 common date patterns from filenames and normalizes them to ISO 8601 format (YYYY-MM-DD), which sorts lexicographically and chronologically. It runs entirely in your browser. No files are uploaded to any server.
The parser handles written months (January through December), numeric formats with various delimiters (hyphens, dots, slashes, spaces), ordinal suffixes (1st, 2nd, 3rd), and ambiguous day/month resolution configurable by the user. Files that contain no recognizable date pattern are flagged but preserved. Limitation: the tool assumes dates refer to the Gregorian calendar and does not validate against impossible dates like February 30.
Formulas
The renaming algorithm applies a priority-ordered chain of regular expressions. Each pattern attempts to extract three date components: year (Y), month (M), and day (D). The output filename follows this structure:
Where pad(n, 2) zero-pads to 2 digits, remainder is the filename with the date substring removed and whitespace/delimiters cleaned, and ext is the file extension preserved verbatim.
For two-digit years, a pivot rule applies:
Month name resolution uses a lookup table mapping both full names (January → 1) and three-letter abbreviations (Jan → 1). The match is case-insensitive. Ambiguous numeric dates (e.g., 03-04-2024) are resolved by the user-selected locale preference: MM/DD (US) or DD/MM (EU).
Reference Data
| Input Pattern | Example Filename | Renamed Output | Regex Strategy |
|---|---|---|---|
| Month DD, YYYY | Meeting Notes March 15, 2024.md | 2024-03-15 Meeting Notes.md | Full month name + day + 4-digit year |
| Mon DD, YYYY | Report Jan 5, 2023.docx | 2023-01-05 Report.docx | Abbreviated month + day + year |
| MM-DD-YYYY | invoice 03-15-2024.pdf | 2024-03-15 invoice.pdf | Numeric with hyphen delimiter |
| DD-MM-YYYY | notes 15-03-2024.txt | 2024-03-15 notes.txt | EU format (user config) |
| YYYY-MM-DD | 2024-03-15 already correct.md | 2024-03-15 already correct.md | ISO 8601 passthrough |
| MM/DD/YYYY | scan 03/15/2024.png | 2024-03-15 scan.png | Slash delimiter US format |
| DD.MM.YYYY | foto 15.03.2024.jpg | 2024-03-15 foto.jpg | Dot delimiter EU format |
| Month DDth, YYYY | Birthday March 15th, 2024.md | 2024-03-15 Birthday.md | Ordinal suffix stripped |
| DD Month YYYY | 15 March 2024 report.md | 2024-03-15 report.md | Day-first with written month |
| YYYYMMDD | backup_20240315.sql | 2024-03-15 backup.sql | Compact 8-digit date |
| MM-DD-YY | log 03-15-24.txt | 2024-03-15 log.txt | 2-digit year (pivot at 70) |
| Month YYYY | Budget March 2024.xlsx | 2024-03-01 Budget.xlsx | Month + year only, day defaults to 01 |
| YYYY_MM_DD | data_2024_03_15.csv | 2024-03-15 data.csv | Underscore delimiter |
| DDth Mon YYYY | 15th Mar 2024 memo.doc | 2024-03-15 memo.doc | Ordinal + abbreviated month |
| No date found | random_notes.md | SKIPPED | No pattern matched |