The tool
What the space to JSON array converter does
Paste a space separated list and get back a valid JSON array of strings. Each run of whitespace acts as one separator, each item is trimmed, and empty items are dropped, so a list with double spaces or a stray line break still converts cleanly.
The output is pretty-printed with two-space indentation, which is the one output format this route produces. It runs in your browser, so nothing is uploaded, there is no item cap and no run limit.
The detail that matters
Splitting on a run of whitespace, not a single space
Most converters that offer a space option split on one space character. Feed one of those a list with a double space in it and you get an empty item in the middle of your array, which then has to be cleaned out by hand.
This route treats any unbroken run of whitespace as a single separator. Two spaces, a tab, a line break, or all three together count as one boundary between items. That means a list copied out of a terminal, a spreadsheet cell or a wrapped email converts without needing to be tidied first.
How it works
How to convert a space separated list to JSON in three steps
There is nothing to configure, so this is genuinely a paste-and-copy job.
- Step 1
- Paste the list. Items separated by spaces, tabs or line breaks all work, in any mixture.
- Step 2
- Run the conversion. It happens instantly, on your own machine.
- Step 3
- Copy the array. Check the item count against what you expected, since that is the fastest way to catch a value that contained a space you did not know about.
What you get back
Every item comes back as a string
This is the thing that surprises people most often, so it is worth being blunt about. The array is always an array of strings. Paste 42 and you get "42". Paste true and you get "true". Paste null and you get "null".
There is no type detection, because guessing types from a flat list is where these converters go wrong. A product code like 007 becomes the number 7 if something infers a type, and the leading zeros are gone for good. Keeping everything a string means nothing is silently reinterpreted, and casting the two values you actually wanted as numbers is a smaller job than finding the ones that got corrupted.
Valid output
Quotes, backslashes and accents come out legal
Items containing a double quote or a backslash are escaped properly, so the array is valid JSON and will parse. A word like "hi" with quotes around it stays intact inside the string rather than terminating it early and breaking the file.
Non-ASCII text passes straight through. Accented words and CJK characters are preserved exactly as pasted, since the conversion never transliterates or strips anything.
Scope, stated honestly
What this converter does not do
It produces a flat array of strings and nothing more elaborate. There are no objects, no nesting and no key-value output, so a table with several columns is not a job for this page.
- No duplicate removal
- Repeated items are kept, in order. The remove duplicate lines route is where deduplication lives.
- No empty strings
- Empty items are always dropped, so a deliberate empty string cannot be produced here.
- No compact output
- The result is always pretty-printed with two-space indentation. The JSON minifier route is the one that compacts it.
- No file upload or API
- It works on text pasted into the page, one list at a time.
Other separators
When your list is not separated by spaces
If your items contain spaces of their own, this is the wrong route, because each word becomes its own item. A list of full names or product titles needs a separator that is not whitespace.
There are separate pages for comma, semicolon, colon, pipe, slash, tab, caret, tilde and double-space lists, and a custom delimiter route for anything else. Picking the page that matches your actual separator is faster than post-processing a wrong result.
Who it's for
Who converts a space separated list to JSON, and when
Mostly developers turning something informal into something a program can read. A list of flags, IDs, tags or filenames pasted from a terminal, a chat message or a ticket, needed as an array in a config file, a test fixture or a request body.
It is also a fast sanity check. Converting a list and counting the items tells you immediately whether one of your values contains a space it should not, because the item count comes back higher than the number of things you pasted.