I like to have my Dock organized and spacers let me do that real easy and nice.

Open up your Terminal.app (search for Terminal in Spotlight or navigate to Applications->Utilites in Finder).

Type this:

defaults write com.apple.dock persistent-apps - array - add '{"tile-type"="spacer-tile";}'

You can type/paste that as many times as you like to have spacers.

Then, type this to restart the Dock.

killall Dock

Now, you can move the spacers as any other app in the Dock, and if you’d like to remove a spacer, drag it out of the Dock and wait for 1 second and release it.