Text

Spaces to Hyphens Converter

Input

Replace spaces with dashes. Ideal for creating URL slugs and filenames.

Options are applied line-by-line.

Output

Sample-line-one
Line-with-leading-and-trailing-spaces
Line-with-multiple-spaces

Frequently Asked Questions

What does this tool do?
It replaces every space character (U+0020) in your input with a hyphen-minus (-). Multiple consecutive spaces can optionally be collapsed into a single dash. Useful for creating URL slugs, filename sanitization, and command-line argument preparation.
What is the difference between a hyphen (-) and an em dash (—)?
A hyphen-minus (-) is the standard ASCII character used in URLs, file names, and compound words. An en dash (–) is typographic, used for ranges (pages 10–20). An em dash (—) is a longer typographic dash used for emphasis. This tool uses the hyphen-minus.
How is this different from the slug generator?
The slug generator does comprehensive URL slug conversion: lowercasing, replacing/removing special characters, collapsing spaces, trimming. Spaces-to-dashes is a simple character substitution tool with no other transformations.