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.

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.

Frequently Asked Questions

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.