Developer

List to JSON Array Converter

Turn a plain list of lines into a JSON array, with control over trimming, blank lines, duplicates and type handling.

Last reviewed by the Radiatus Cloud team

Need this built for your product?

We design, build & host secure software & APIs.

Talk to an engineer

The everyday task

You have a column pasted from a spreadsheet, a list of IDs from a query result, or lines copied from a log, and you need it as a JSON array for a config file, an API request body or a test fixture. Doing it by hand means adding quotes and commas to every line, which is tedious and error-prone past about ten items, and the mistakes are always the same: a missing trailing quote or an extra comma before the closing bracket.

Trailing whitespace is invisible and real

Lines pasted from a terminal or spreadsheet frequently carry trailing spaces or a carriage return from Windows line endings. Those characters end up inside the JSON strings, and the resulting values do not match anything when compared. Trimming each line is almost always what you want, and when a lookup mysteriously fails on data that looks identical, this is usually why.

Strings or numbers

A list of numeric-looking values can become JSON strings or JSON numbers, and the choice matters. Identifiers, postcodes, phone numbers and any code with a leading zero must stay strings, because converting 01234 to a number silently drops the zero. Genuine quantities should be numbers. There is no way for a converter to know which you have, so decide rather than accepting a default.

Blank lines and duplicates

A trailing newline at the end of a paste produces an empty final element, which is rarely intended. Duplicates may be meaningful or may be an artefact of how the list was assembled. Both are easier to handle at conversion time than to debug later in whatever consumes the array.

Escaping

Any double quote or backslash inside a line must be escaped, and a literal tab or newline within a value needs its escape sequence. This is exactly the class of detail hand-editing misses, and it produces a JSON document that fails to parse with an error pointing several lines away from the real problem.

Related tools

  • JSON Formatter — Format and beautify JSON in your browser. Pinpoints syntax errors by line and column, flags unsafe integers, and never uploads your data to a server.
  • JSON Validator — Validate JSON syntax with precise line and column errors, and check documents against a JSON Schema. Runs locally in your browser, nothing uploaded.
  • Regex Tester — Test regular expressions against sample text with live match highlighting, capture groups and flag control. Runs entirely in your browser.
  • HTML Minifier — Minify HTML by removing comments and redundant whitespace, without breaking inline elements or pre blocks. Runs entirely in your browser.

Frequently Asked Questions

Why do my values not match after conversion?

Almost always trailing whitespace or a Windows carriage return carried in from the paste. Those characters sit inside the JSON strings and stop the values matching anything. Trim each line.

Should numbers become JSON numbers or strings?

Strings for identifiers, postcodes, phone numbers and anything with a leading zero, since converting 01234 to a number drops the zero. Numbers only for genuine quantities.

Why is there an empty element at the end?

A trailing newline at the end of the paste produces an empty final item. It is rarely intended and is easier to remove at conversion time than to debug downstream.

Are quotes inside lines handled?

They must be escaped, along with backslashes and any literal tab or newline. Missing this produces a document that fails to parse with an error pointing away from the real problem.

Should duplicates be removed?

It depends whether they are meaningful or an artefact of how the list was assembled. Deciding at conversion time is easier than discovering the answer in whatever consumes the array.

Privacy & Security

All processing happens locally in your browser — nothing is uploaded.

Data: None
Client-side-Side
Active
v1.0

How to Use

Paste one item per line; a JSON array is generated. Toggle type detection and pretty printing.

Disclaimer: This tool is provided "as is" without warranty of any kind. Results are for educational and utility purposes.