Ready, runs in your browser
0 chars · 0 words
spaces treated as the split
2+
bytes leaving your device
0
no signup, no run limit
Free

Double space to JSON array

What the double space to JSON array converter does

You paste text that was lined up into columns with spaces. The double space to JSON array converter finds every run of two or more spaces, cuts there, trims the pieces and hands back a JSON array ready to paste into code.

The reason it is a separate tool from the plain space converter is one behaviour: single spaces are ignored. A column containing "Los Angeles" or "quality assurance" arrives as one entry rather than two, which is exactly what fails when you split on any whitespace.

It all happens in the page. Nothing is uploaded, there is no run limit, no length cap and no account to make.

Where it fits

Where a double space to JSON array step sits in your work

The pattern is nearly always the same: something formatted for a human needs to become something a program reads.

Terminal output to a fixture
A command printed a padded table. You need those values as an array in a test.
PDF extract to config
Text pulled out of a PDF is usually padded with runs of spaces rather than tabs.
Document table to seed data
A table pasted as plain text keeps its alignment as spaces, which is exactly what this splits on.
Spec to enum
A list of allowed values written out in columns, headed for a TypeScript union or a validation schema.
One-off shaping
Fifteen values on screen that need to be JSON in the next thirty seconds, without opening an editor.

The workflow

How to convert column-aligned text to JSON in three steps

Nothing to configure, so the whole loop is a paste and a click.

Step 1
Paste the column-aligned or double-spaced text into the box.
Step 2
Press Convert to JSON. The split runs locally and the array appears immediately.
Step 3
Count the entries against the columns you expected, then copy the array out.

Before you trust it

The exact rules the converter applies

Five behaviours to know, because each one shows up in real output.

Two or more spaces cut
The width of the gap does not matter. Two spaces and twelve spaces both split in the same place.
Pieces are trimmed
Whitespace around each segment is stripped before it becomes an entry.
Blank pieces are dropped
Anything that trims away to nothing is removed, so you cannot keep a deliberate empty string.
Values stay strings
A column of numbers comes back quoted. There is no type detection in this converter.
Escaping is correct
Quotes, backslashes and line breaks inside an entry are escaped, so the output parses as valid JSON.

A worked example

What goes in, and what the JSON array looks like

Say a row of your table reads apples, then a gap, then Los Angeles, then a gap, then 40. The gaps are whatever padding the original alignment happened to use, and they are not the same width as each other.

You get a three-item array back: apples, Los Angeles and 40. Los Angeles held together because the space inside it is a single space. The 40 is quoted, because every piece is treated as text. The array is printed with a two-space indent and one entry per line, which keeps it readable when it lands in a pull request.

The catch to plan for

Line breaks are not a separator on this page

Only spaces split here. If you paste a table with five rows, the line breaks are not cut points: each one stays inside whatever entry it falls in and shows up in the output escaped as a backslash-n.

For a multi-row table the workable approach is one row per conversion, or joining the rows before you paste. If your data is genuinely one item per line, a line-break split is a different tool and will give you a cleaner array in one pass.

When it returns one entry

What breaks when the alignment is not a true double space

The most common failure is tabs. Terminal output, spreadsheet exports and log files very often align with tab characters, which look identical to spaces on screen and do not match this rule at all. A tabbed table converts to a single long entry.

The second is an invisible space variant sitting in the gap: a no-break space or a narrow no-break space. Both render like an ordinary space and neither is one. If the array comes back with one item where you expected six, the gap is the thing to inspect.

Choosing a converter

Which converter to reach for when this is not the one

Other sites put every separator behind one dropdown. Here each separator is its own page, so choose by what is physically in the gap.

Tab characters
The tab to JSON array converter. This is the right answer more often than people expect.
Single spaces
The space converter, which splits on any whitespace run and will separate multi-word entries.
Punctuation separators
Comma, semicolon, colon, pipe, slash, caret and tilde each have a dedicated converter.
Anything else
The custom delimiter converter is the only one with a delimiter field, and it takes whatever string you type.
FAQ

Everything answered. Double space to JSON array questions

How do I convert double-spaced text to a JSON array?

Paste the text, press Convert to JSON, then copy the array. Everything runs in the page.

Does it have to be exactly two spaces?

No. Any run of two or more spaces splits, so uneven column padding works fine.

Will multi-word entries survive?

Yes. Single spaces never split, so "Los Angeles" stays as a single entry.

Is the converter free?

Yes. No account, no signup, no run limit and no length cap.

Does my text get uploaded?

No. The conversion runs in your browser and nothing you paste leaves your device.

Does it split on tabs?

No. Tabs are a different character. The tab to JSON array converter handles those.

Does it split on line breaks?

No. A newline stays inside its entry and appears escaped as a backslash-n in the output.

Do numbers come out as JSON numbers?

No. Every entry is a quoted string, because this converter does no type detection.

Can I get an object with keys instead of an array?

No. The output is always a flat array of strings, never keyed and never nested.

Is the JSON formatted or minified?

Formatted, with a two-space indent and one entry per line.

What happens to blank entries?

They are dropped. Anything that trims to nothing is removed from the array.

Are quotes in my text handled safely?

Yes. Escaping is applied, so quotes, backslashes and newlines cannot break the JSON.

Does it remove duplicate entries?

No. Repeats are kept. There is no dedupe option on this converter.

Why did I get back a single entry?

The gaps are probably tabs, no-break spaces or narrow no-break spaces. None of those match the split rule.

Can I upload or download a file?

No. This is a paste-in, copy-out box with no file handling.

Is there a maximum length?

No fixed limit. Because it runs locally, your own browser is the only ceiling.

Does it work on a phone?

Yes, in any modern mobile browser.

Can I set my own delimiter on this page?

No. The delimiter here is fixed. The custom delimiter converter is the one with an input for it.

How is this different from the space converter?

The space converter splits on any whitespace run. This one only splits where two or more spaces sit together.

Will it fix columns that were misaligned in the source?

No. It cuts where the spaces are, so bad alignment produces a matching array.

Is there a batch mode or an API?

No. Conversions happen one paste at a time in the page.

Does the order of entries change?

No. Entries come out in the order they appeared in your text.