


(I am sure there is a relatively simple way to do it on Windows, but I am not aware of a built-in utility to do so.)Īll modern Mac’s (MacBooks, MacBook Pros, iMacs, Mac Pros, etc.) have a built in application called Automator that will allow you to build a simple tool to replace spaces in file names and replace them with whatever character you choose. The good news is that replacing spaces with hyphens can be easy to do, even in batches, if you have an Apple MacIntosh computer. Replace spaces with hyphens in bulk on a Mac with Automator. It takes multiple clicks and is highly inefficient. Then you can manually delete and replace the spaces with hyphens.īut it is a tedious process, especially if you have multiple filenames to edit. The manual method is is to open your file browser (Finder on Mac, File Explorer on Windows), find the file you need to change, and then right click and select “rename”. How to replace spaces with hyphens in filenames.


But in most cases people use these terms interchangeably. There is actually a separate character that is a “dash” that is longer than the hyphen. To be clear, the hyphen (sometimes called dash) is the little line on the top right of the US English keyboard ( – ) that is also used as the minus sign. So, using a hyphen is preferred over spaces, and even over just mashing filenames into one long word (e.g., image-name-without-spaces.jpg is better than imagenamewithoutspaces.jpg for both humans and algorithms). The hyphen is preferred by most search engines as it helps their algorithms determine the relevance of a file for search purposes. I prefer to use a hyphen, and if you look around you’ll notice the best practice is to use hyphens. Most people chose to use either a hyphen ( – ) or and underscore ( _ ) instead of a space. What character should I use instead of a space? But if you work in the web world, even if just a personal blog, take the time to remove the spaces. Any file uploaded and linked will have this issue if it has spaces. gif, etc.) as well as all document formats (.doc. The same is true for all image file formats (.png. So an image file named “image name with spaces.jpg” becomes “image%20name%20with%20spaces.jpg” when uploaded to a website. You can do it, but every space gets replaced with “%20” in the file’s URL. So how can you replace spaces with hyphens easily? If you work with the web at all, you probably know that having spaces in a filename online is not a good idea.
