BYTETOOLS

List to JSON Array Converter

Convert a list of lines into a JSON array of strings, numbers or objects, with trim, dedupe and pretty-print options plus a reverse mode.

What is the List to JSON Array Converter?

List to JSON Array Converter turns a plain list into valid JSON you can paste straight into code. Every line becomes an array item, correctly escaped by the browser's own JSON encoder, so quotes, backslashes and unicode characters in your text can never break the output.

  • Proper JSON escaping for quotes, backslashes and unicode
  • Output as strings, numbers or objects with a custom key
  • Trim, skip blank lines and remove duplicates
  • Pretty-print with 2 or 4 spaces, or minify
  • Reverse mode flattens a JSON array back to plain lines
  • Reports how many items converted and how many were skipped

How to use the List to JSON Array Converter

  1. 1

    Pick the direction: lines to a JSON array, or a JSON array back to lines.

  2. 2

    Paste your list or your JSON into the input box.

  3. 3

    Choose whether items should be strings, numbers or objects, and name the object key if needed.

  4. 4

    Toggle trim, skip empty lines and remove duplicates to clean the list as it converts.

  5. 5

    Copy the JSON or download it as a file.

About the List to JSON Array Converter

List to JSON Array Converter turns a plain list into valid JSON you can paste straight into code. Every line becomes an array item, correctly escaped by the browser's own JSON encoder, so quotes, backslashes and unicode characters in your text can never break the output.

Choose whether items come out as strings, as numbers, or as objects under a key name you pick. Trim whitespace, skip blank lines and remove duplicates as you go. The reverse direction takes a JSON array and flattens it back to one item per line, reading a named key when the array contains objects.

The conversion happens entirely in your browser and nothing is uploaded. That makes it safe for internal lists, customer data or anything else you would rather not paste into an online service. The tool also reports how many items were produced and how many lines were skipped, so you can tell at a glance whether the whole list made it through.

Frequently asked questions

How do I turn a list of lines into a JSON array?

Paste the list with one item per line and the JSON array appears instantly. The browser's own JSON encoder handles the escaping, so special characters are always correct.

What happens to lines that are not valid numbers?

In number mode those lines are left out and the tool tells you how many were skipped. Switch to string mode if you want every line included exactly as typed.

Can I create an array of objects instead of strings?

Yes. Choose objects with a key and name the key, and each line becomes an object like that key mapped to the line text. It is a quick way to build seed data or fixtures.

How do I convert a JSON array back into a plain list?

Switch the direction to JSON array to lines and paste your array. Strings and numbers come out as-is, and for objects you can name a key to read the value from.

Does my data get uploaded?

No. Everything is converted locally in your browser, so internal lists and customer data never leave your device and the tool works offline.

Related tools