Skip to content
Column to Comma,
More free tools

Column to JSON array: turn rows into a valid JSON list

Paste one value per line. The tool returns a JSON array: double quotes around text, numbers left bare, and square brackets around the list.

Direction
Quick:
Options

Options

Your text never leaves your browser. Read how we handle data.

Example

This input:

blue
42
3.5
say "hi"
C:\temp

gives this output with the settings on this page:

["blue", 42, 3.5, "say \"hi\"", "C:\\temp"]

A JSON array in one step

Paste the rows and copy the result. Text becomes "text", numbers stay as numbers, and the list is wrapped in [ ]. You can paste it into a request body, a config file or a test fixture.

The tool escapes characters the way JSON requires. A double quote becomes \", a backslash becomes \\, and a tab or line break inside a value becomes \t or \n.

What counts as a number

A JSON number has no plus sign and no leading zeros. The values 42, -7 and 3.5 stay bare. A value such as 007 or +5 is not valid JSON as a number, so it is quoted as text.

Using the array in code

  • JavaScript: paste it into const items = ...;.
  • Python: a JSON array of strings and numbers is also a valid Python list.
  • cURL and API tools: paste it into the JSON body.
  • For a Python list with single quotes, use the single quote page instead.

Questions about this page

Is the output always valid JSON?

Yes for text and numbers. The tool escapes quotes, backslashes and control characters. It does not make objects, only an array of values.

Can I put every item on its own line?

Yes. Choose Custom in the Separator menu and type ,\n so each item ends with a comma and a line break. The result is still valid JSON.

What about true, false and null?

They are treated as text, so they get quotes. Remove the quotes by hand if you need real booleans.

More conversions

More free tools from Bingemind