File naming conventions that stay sorted

Renaming a folder is easy. Choosing names that are still useful in two years — when you have four thousand of them, they have been through three backup systems and two operating systems, and somebody else has to find one — is the part worth thinking about. This guide covers the handful of conventions that do the real work, and the specific habits that quietly cause problems later.

The one date format that sorts

If a filename begins with a date, there is really only one format to use: YYYY-MM-DD. It sorts correctly as plain text, which means it sorts correctly in every file manager, every backup tool and every script you will ever point at the folder.

The alternative that people reach for by habit, DD-MM-YYYY, is a trap in two separate ways. Sorted alphabetically, it produces a list grouped by day across all months and years — the 1st of every month together, then the 2nd of every month. And it is ambiguous to a reader: 03-04-2026 is the third of April to one person and the fourth of March to another, with no way to tell which was meant.

Spelled-out month names (3 Apr 2026) solve the ambiguity but create a new problem: alphabetical order now puts April before January. There is no format that both sorts and reads naturally; pick the one that sorts.

Zero padding is not cosmetic

Compare these two lists. The left one is unsorted to a computer and the right one is sorted:

Without paddingWith padding
file-1
file-10
file-2
file-9
file-01
file-02
file-09
file-10

Sorted as text — which is how every file manager does it by default — file-10 comes between file-1 and file-2, because the character 1 precedes the character 2. The fix is to pad every number to the same width, and the width has to be chosen for the largest number the folder will ever contain, not the largest it contains today. If you pad to two digits when there are fifteen files, file number one hundred will break the order again.

A practical rule: pad to one digit more than the biggest number you can plausibly reach. Numbering up to a few hundred files? Use three digits. This is why the rename tool's padding control is a fixed choice rather than something inferred from the folder — it has to look forward, not backward.

Characters that break things downstream

A filename is not just a label. It becomes part of a URL, a command-line argument, an email attachment name, an archive entry and a database key, and some characters cause trouble in one or more of those places.

CharacterWhat goes wrong
/ and \Not permitted at all — they are the path separators. Most systems reject them outright, and the ones that do not will interpret them as directory changes.
: ? * " < > |Rejected by Windows. Files carrying them from another system become difficult to copy, sync or open.
SpacesLegal but awkward. A space becomes %20 in a URL, and every command-line reference to the file needs quoting. In URLs specifically, use a hyphen instead: search engines treat hyphens as word separators and underscores as joining words.
CommasBreak naive spreadsheet and CSV imports, because the comma is the field separator. A batch of product records whose filenames contain commas will import into the wrong columns.
Leading or trailing spaces and trailing dotsSilently stripped by Windows, so a file can appear to have a name that no longer matches what you typed.
A leading dotMakes the file hidden on every Unix-like system, which is a confusing way to lose a file.
Emoji and non-Latin charactersWork on modern systems but break older backup tools, some archive formats and any script that assumes ASCII. Fine for personal files, risky for anything that has to be exchanged.

The safe set is smaller than most people expect: letters, digits, hyphens and underscores. Everything else is a small risk taken for a small gain in readability.

Capitalisation, and the case-only rename

Windows and macOS treat filenames as case-insensitive; Linux treats them as case-sensitive. This difference creates a specific hazard when renaming: on a case-insensitive system, Photo.JPG and photo.jpg are the same file, so a rename that only changes capitalisation may either do nothing or, worse, be treated as a conflict with itself depending on the tool.

It also means a folder that works perfectly on your machine can produce duplicate-looking names once it is uploaded to a Linux server — where Report.pdf and report.pdf are two separate files that both exist. If a folder is destined for a web server or a Linux machine, pick one convention — all lower case is the usual one — and apply it before uploading rather than after.

The rename tool checks for conflicts case-insensitively when it previews the result, precisely because of this: a change that is safe on Linux can overwrite a file on Windows.

Versioning without the "final-final" spiral

Version suffixes are where naming schemes collapse. The familiar sequence runs draft, final, final2, final-v2, final-v2-really, and at the end of it nobody knows which file was sent to whom.

Two schemes survive contact with real work:

If you need to mark a file as the one that went out, add a status token rather than another number: approved, sent, superseded. Sorted alphabetically they group together, and unlike "final" they never need a follow-up word.

Conventions for common jobs

Product photos for a marketplace

Prefix with the SKU so the image can be matched back to the listing by name alone, then the view, then a padded sequence: SKU-4471-front-01.jpg, SKU-4471-side-02.jpg. The SKU first is deliberate — sorting the folder groups every image of the same product, which is what you want when checking whether a listing has all its views.

Avoid renaming these files for aesthetics. If they are already referenced in a spreadsheet or a listing import, a rename breaks the link with no error message.

Documents and receipts

Date first, then a short description, then the counterparty: 2026-09-20-invoice-acme.pdf. Date first means the folder is a chronological ledger without any additional structure. Keep the description generic enough that you will still write the same word next year.

Photo archive

Date, then event, then a sequence: 2026-07-14-wedding-014.jpg. This is the case where padding matters most, because a large event easily runs into the thousands and a two-digit pad will break partway through.

Renaming safely

The order of operations matters more than the pattern:

  1. Preview the whole list before applying anything. Read the new names as they will be, in order, and look for two failures: names that will collide, and names that lost information you needed.
  2. Check for conflicts, and treat a conflict as a stop. Two files resolving to the same name means one overwrites the other, usually silently.
  3. Rename in place rather than copy-and-rename where the tool allows it. A copy leaves the originals behind and now you have two sets with different names.
  4. Do not chain find-and-replace operations. Replacing _ with - and then - with _ in the same pass is not a swap; it is two sequential substitutions and the second undoes the first.
  5. Keep the originals until you have opened a few renamed files. A rename is reversible in principle, but only if you remember the previous names.
Rename a batch of files →

Pattern, numbering, find-and-replace, live preview and conflict detection. In Chrome and Edge it renames the files on your disk directly, through the browser's file system API — nothing is uploaded and no copies are made.

Frequently asked

Should I use hyphens or underscores?

For anything that will become a URL, use hyphens. Search engines treat a hyphen as a word separator and an underscore as a joiner, so red-widget reads as two words and red_widget as one. For internal files where no URL is involved, either is fine — just be consistent, because consistency is what makes a naming scheme learnable.

How long can a filename be?

Individual names are limited to around 255 characters on all common systems, but the more common constraint is the total path length, which is capped much lower on some setups. Deeply nested folders with long names hit that ceiling first. Keeping names short is a reasonable default, and the practical limit people settle on is a name you can read at a glance in a file listing.

Why did my rename appear to do nothing on Windows?

Most likely it only changed the capitalisation. Windows treats filenames as case-insensitive, so it can consider the new name identical to the old one and skip the operation. Renaming in two steps — to an intermediate name and then to the target — is the usual workaround.

Is it safe to rename files inside a synced folder?

Yes, but the sync client sees a rename as a delete plus a create unless it recognises the pair. On a large folder that means re-uploading, so it is worth renaming before a folder is first synced rather than after. Keep the folder size and count in mind if your plan has transfer limits.

What is the single most useful convention to adopt?

Put the date first, in YYYY-MM-DD form, and pad every number. Those two habits account for most of the benefit of a naming scheme, and they cost nothing to follow.

Related