Sharecrate Safe File Names

Make file names safe for Windows, macOS, Linux and ZIP files, and fix duplicates.

Paths are cut to their last part. At most 2000 names.

Try an example: ·

More about this tool

Part of Sharecrate

How it works

Paste file names, one per line, and get names that work everywhere: no characters Windows refuses, no reserved device names like CON or NUL, no hidden text-direction characters that disguise an extension, Unicode in the composed form (NFC), no trailing dots or spaces and at most 200 bytes with the extension kept. Names that become equal are numbered the way Sharecrate does it, and program extensions are flagged.

  • Each name is converted to Unicode NFC, then control characters, bidirectional controls (U+202A–U+202E, U+2066–U+2069, U+200E/U+200F, U+061C) and zero-width characters are removed.
  • The characters / \ : * ? " < > | become _, repeated spaces collapse to one, and dots or spaces at the start and end are removed (Windows drops trailing ones; leading dots hide files on macOS and Linux).
  • Windows device names (CON, PRN, AUX, NUL, COM0–9, LPT0–9 and their superscript forms) get an underscore, also when they have an extension. Names longer than the byte limit are shortened before the extension.
  • Duplicate detection compares names case-insensitively, like Windows, macOS and the Sharecrate drive; later names get “ (2)”, “ (3)” … before the extension.
  • Program and macro extensions (.exe, .js, .docm …) and double extensions like .pdf.exe are flagged, not changed.

Sources

Part of Sharecrate

  • Sharecrate Shared team drive

    One shared drive per team workspace: folders, uploads, previews, versions and links.

    Open Sharecrate

How to use Sharecrate Safe File Names

Clean a list of file names so they work on Windows, macOS, Linux and in shared drives, with every change explained.

What it is for

A file called Q3 report: final?.pdf is fine on a Mac, but Windows refuses to save it, a sync client skips it and a zip archive made on one system unpacks with errors on another. Shared drives collect names from all of these places, so trouble shows up as missing files or “invalid name” errors weeks later.

Paste one name per line and the tool returns a safe version of each, the reason for every change and a warning for names that disguise programs. It follows the same rules Sharecrate uses when you upload, so you can check names before you move a folder into a team drive or hand files to someone on another system.

It does not rename anything on your computer and it does not look inside files — it only works on the names you paste.

Worked example

Seven names from a messy project folder:

Q3 report: final?.pdf
AUX.txt
photo 01.JPG
Photo 01.jpg
notes.
Invoice‮fdp.exe
  budget   2027 .xlsx

The summary reads: 6 of 7 names changed, 1 renamed to avoid duplicates; 1 flagged as programs or macros.

  • Q3 report: final?.pdf → Q3 report_ final_.pdf — the colon and question mark are not allowed on Windows.
  • AUX.txt → AUX_.txt — AUX is a reserved device name on Windows, even with an extension.
  • photo 01.JPG stays as it is, but Photo 01.jpg becomes Photo 01 (2).jpg: on Windows and macOS the two names count as the same file, so one would overwrite the other.
  • notes. → notes — Windows silently drops dots and spaces at the end.
  • The invoice line contains an invisible right-to-left mark that makes Invoicefdp.exe look like Invoiceexe.pdf. The tool removes it and warns that .exe files can run programs.
  • Extra spaces are collapsed: budget 2027 .xlsx.

How to read the result

The table lists every line with the original name, the safe name and the reasons. Rows marked as renamed for a duplicate are the ones that would otherwise collide after cleaning. Warnings appear for program and macro files (.exe, .bat, .js, .docm and similar) and for double extensions such as report.pdf.exe.

Below the table you get the cleaned list again, one name per line, ready to copy into a rename script or a spreadsheet.

Tips and common mistakes

  • Paste names only, not full paths: for holiday / beach.png the tool keeps only the last part, beach.png, because slashes separate folders.
  • Leave Number names that become equal on when the names end up in one folder. Turn it off when you only want to see which characters are a problem.
  • Duplicates are compared the way Windows and macOS do: upper and lower case and the Unicode form of accents do not matter, so Résumé typed on two systems still counts as the same name.
  • Names longer than 200 bytes (UTF-8) are shortened at the end of the base name; the extension stays.
  • Treat the program warning seriously even when the name looks harmless — hidden direction marks are a known trick in phishing attachments.

FAQ

Why are leading dots removed?

On macOS and Linux a name starting with a dot is hidden. In a shared drive that usually means a file nobody can find, so the tool removes the dot and says so.

Does the tool change accented letters or emoji?

No. They are valid on every current system. The tool only normalises them to one Unicode form so the same name typed on a Mac and on Windows compares as equal.

Is this the same check Sharecrate does on upload?

Yes. Sharecrate uses the same rules when you upload or rename files, and it also adds a number when a name already exists in the folder.

Can I clean names of a whole folder at once?

Paste the output of dir /b (Windows) or ls (macOS, Linux). Each line is treated as one name.

Guide last updated:

For scripts and AI agents

  • JSON API: POST https://sharecratesafefilenames.usefulweb.app/api/v1/calculate (same calculation as this page)
  • Interface description: OpenAPI 3.1 · AI guide: llms.txt
  • MCP server (Streamable HTTP): https://sharecratesafefilenames.usefulweb.app/mcp · tool name sharecrate_safe_filenames
Example request
curl -s -X POST https://sharecratesafefilenames.usefulweb.app/api/v1/calculate \
  -H 'content-type: application/json' \
  -d '{"names":"Quarterly report: final?.pdf\nCON.txt\nnotes .\n../../etc/passwd\nInvoice‮fdp.exe\nRésumé.docx\nRésumé.docx\nphoto<1>.jpg\n   spaced    out   name.png\n.hidden-config","dedupe":true}'
Feedback · ideas & bug reports welcome