Clean File Names for Websites: Using Slugs for Images and PDFs
Why file names matter for websites, how to name images and documents for SEO and reliability, and how to batch-create clean file names.
File names become part of URLs when you upload images, PDFs and other documents to a website. Messy names cause broken links and miss an easy chance to describe your content.
Problems with messy file names
IMG_4821.JPGtells people and search engines nothing.Final Report (v3) FINAL.pdfcontains spaces and brackets that become%20and other encoded characters.- Mixed capitals cause broken links on case-sensitive servers.
Rules for clean file names
- Lowercase only.
- Hyphens between words, no spaces.
- Descriptive words:
red-trail-running-shoes.jpg. - No special characters such as &, %, # or accented letters.
- Keep the extension lowercase:
.jpg, not.JPG. - Keep it reasonably short.
Image SEO
Google's image guidelines note that file names can give clues about an image's subject. A descriptive file name, combined with useful alt text and relevant surrounding content, helps images appear in image search. File names are a small factor; alt text and page context matter more.
Documents and downloads
For PDFs and other downloads, a clear name helps users find the file later in their downloads folder: ns-tools-hub-password-checklist.pdf is far more useful than document.pdf.
Batch renaming
- List your file titles, one per line.
- Paste them into the slug generator with bulk mode on.
- Copy the slugs and add the file extension.
- Rename files using your operating system's batch rename feature or a script.
For internal files, you can switch the separator to underscore if your team prefers it, but hyphens are the safer choice for anything published on the web.
Frequently asked questions
How to name images for SEO?
How to name images for SEO: describe the image in a few lowercase words separated by hyphens, such as red-running-shoes.jpg. Image file names for SEO are a small signal; alt text matters more.
What are good file naming conventions for websites?
Good file naming conventions: lowercase, hyphens, no spaces or special characters, descriptive words and lowercase extensions. Apply the same rules to PDF file names.
How to rename files for the web in bulk?
To rename files for the web, list the titles one per line, run them through our bulk slug generator and use your operating system's batch rename files feature or a script with the new names.
Try the free Slug Generator
Turn titles into clean, SEO-friendly URL slugs with bulk mode and smart trimming.
Open Slug Generator