gptcleanuppro.com / space-to-json-array
Ready · local0w
Works with text copied from
ChatGPTClaudeGeminiGrokCopilotPerplexity
bytes sent to a server
0
type of every element
String
indentation, fixed
2-space

The tool

A space to JSON array converter with fixed semantics

The transformation is fully specified and has no options. The input is split on a whitespace-run pattern, each fragment is trimmed, empty fragments are discarded, and the surviving fragments are serialised as a JSON array of strings with two-space indentation.

Every part of that sentence is a decision with consequences, and the rest of this page is those consequences. The work runs client-side in JavaScript, so there is no upload, no element cap and no run limit.

Semantics

Why splitting on a whitespace run matters

The distinction between splitting on one space character and splitting on a run of whitespace shows up immediately on real input. Split on a single space and "alpha beta" yields three fragments, the middle one empty. Split on a run and it yields two.

This route uses the run form, so consecutive spaces, tabs, line feeds and carriage returns collapse into one boundary. The practical effect is that input pasted from a terminal, a wrapped message or a spreadsheet cell needs no preprocessing. Documented competitors that split on a literal single space do not behave this way, and the difference is visible in the element count rather than hidden.

Procedure

How to convert a space separated list to JSON in three steps

Verification belongs in the procedure, not after it.

Step 1
Paste the list in whatever spacing it arrived with. Irregular separators are handled by the delimiter semantics above.
Step 2
Run the conversion, which is a local, synchronous transformation.
Step 3
Compare the element count with the number of intended values. A surplus indicates a value containing internal whitespace, which is the only failure this route can produce silently.

Typing

Every element is a string, deliberately

No type inference is performed. Numeric-looking fragments, the literals true and false, and null all serialise as strings. "42 true null" produces three string elements, not a number, a boolean and a null.

Inference is the wrong default for a flat list because it is lossy and irreversible in exactly the cases that matter. An identifier of 0042 parsed as a number loses its padding, a version string of 1.10 collapses to 1.1, and a value in exponential form is rewritten entirely. Casting a known subset of elements downstream is cheap; detecting which elements were silently rewritten is not.

Correctness

Escaping and encoding, verified

Serialisation goes through the standard JSON serialiser, so escaping is not hand-rolled. A fragment containing a double quote is emitted with the quote escaped, a fragment containing a backslash is emitted with it doubled, and the resulting document parses without intervention.

Encoding is preserved as well. Accented Latin text and CJK characters are emitted unchanged rather than escaped into surrogate sequences or stripped, so round-tripping the output through a parser returns the original strings.

Limits, stated

What this route does not implement

Each of these is a feature some competing converter offers. None of them exists here, and the honest answer is more useful than an ambiguous one.

Deduplication
Not implemented. Repeated fragments produce repeated elements, in input order. Deduplication is a separate route.
Empty-element preservation
Not available. Empty fragments are filtered unconditionally, so an intentional empty string cannot be emitted.
Compact serialisation
Not offered. Indentation is fixed at two spaces. The JSON minifier route produces the compact form.
Structured output
No objects, no nesting, no key-value emission. Tabular input belongs with a CSV converter.
Ingest features
No file import, no batch, no API, no saved configuration.

Applicability

When whitespace is the wrong delimiter for your data

Whitespace is a poor delimiter for any value that contains whitespace, which is most human-readable text: names, titles, addresses, sentences. On such input this route is not malfunctioning when it produces one element per word, it is doing exactly what a whitespace delimiter means.

Fixed-delimiter routes exist for comma, semicolon, colon, pipe, slash, tab, caret, tilde and double space, and a custom delimiter route accepts an arbitrary string. Selecting the route that matches the data is strictly better than repairing a wrong split afterwards.

Applications

Who converts a space separated list to JSON, and why

The applications are all cases where a list exists in an informal medium and is needed in a machine-readable one.

Configuration authoring
Promoting a list of flags, hosts or identifiers from a message or a shell history into an array literal.
Fixture construction
Producing deterministic test data from a list supplied in a ticket, without hand-quoting each element.
Request body assembly
Building an array parameter for an API call where a quoting error is otherwise the likeliest defect.
FAQ

Space to JSON array, answered precisely

All answered in full, nothing to click open.

How do I convert a space separated list into a JSON array?

Paste the list and run the transformation. Fragments separated by whitespace become string elements in a serialised array.

Is it free?

Yes. No element cap and no run limit, because the work happens on your own device rather than a metered server.

Is my list uploaded anywhere?

Not by this route. The transformation runs client-side. Other tools on this site that rewrite or generate text send content to a server and say so on those pages.

What is the exact delimiter?

A run of whitespace. Consecutive spaces, tabs and line breaks act as one boundary rather than several.

Do double spaces create empty elements?

No. That is the difference between splitting on a whitespace run and splitting on a single space character.

Are numeric values emitted as JSON numbers?

No. All elements are strings. Type inference is not performed at any point.

Why is type inference refused?

Because it is lossy and irreversible for padded identifiers, version strings and exponential notation.

How is escaping handled?

By the standard JSON serialiser, so quotes and backslashes inside elements are escaped correctly and the document parses.

Is Unicode preserved?

Yes. Accented and CJK characters are emitted unchanged rather than escaped or stripped.

Are duplicates removed?

No. Repeated fragments produce repeated elements in input order.

Can empty strings be preserved?

No. Empty fragments are filtered unconditionally.

Can the output be compact?

Not from this route. Indentation is fixed at two spaces, and the minifier route compacts it.

Can it emit objects or nested structures?

No. The output is always a flat array of strings.

What if elements contain internal spaces?

They are split. Use a delimiter route matching the real separator, or the custom delimiter route.

Which fixed delimiter routes exist?

Comma, semicolon, colon, pipe, slash, tab, caret, tilde and double space, alongside a custom delimiter route.

Is there a size limit?

No. Nothing is transmitted, so nothing is metered.

Is there file import, batch processing or an API?

None of them. This route processes one pasted list.

Does it work in a mobile browser?

Yes, with identical behaviour to desktop.

How do I detect a bad split?

Compare the element count with the number of intended values. A surplus means a value contained internal whitespace.

Is trailing whitespace on the input a problem?

No. Fragments are trimmed and empty fragments are dropped, so leading and trailing whitespace has no effect on the output.

Is the output stable across runs?

Yes. The transformation is deterministic, with no ordering or formatting variation between runs.

Is it safe for confidential lists?

Yes. Nothing is transmitted or retained, because nothing leaves the browser.

Deterministic list to array conversion.

Computed in your browser, with fixed semantics, no upload and no element cap.

Open the converter