Spaces to Commas Converter
runs in your browserno sign-upfree
Replace the spaces between words or numbers with commas — line by line or as one list. Multiple spaces count as one; add quotes or brackets if needed.
About this tool
This tool replaces the spaces between words or numbers with commas. Several spaces or tabs in a row count as one, each line is converted separately (so rows stay rows), and you can add a space after each comma, quotes, or brackets. Untick "Keep each line separate" to merge everything into one comma-separated list.
How to use
- Paste your space-separated text.
- The comma-separated result appears instantly, line by line.
- Adjust the options: one list or line by line, space after commas, quotes, brackets.
- Copy or download the result.
FAQ
What about double spaces?
Any run of spaces or tabs counts as one separator, so "a b" becomes "a, b" — no empty items.
How do I make a list for SQL IN (...) or a JSON array?
Choose Quotes 'Single' and Wrap ( … ) to get ('a', 'b', 'c') for SQL — apostrophes inside items are doubled, as SQL needs. Choose Quotes "Double" and Wrap [ … ] to get a JSON or JavaScript array.
Can I convert between other separators?
Yes. Pick any separator under From and To: new line, comma, space, tab, semicolon, pipe or your own (like :: or " -> "). The ⇄ button swaps the direction and uses the result as the new input.
Is my data uploaded?
No. Everything happens in your browser, and your last input is saved only in this browser.