Text to JSON

Text to JSON Array Converter

Convert text, lists, or comma-separated values into a valid JSON array instantly.

Build the JSON array

Strict JSON array builder

0 items / 0 unique
Input Text
0 characters Ctrl+Enter to convert - Drag and drop .txt
Split Input By
Cleaning Options
Output
JSON options
Value handling
Output 0 unique Output
// Your converted output will appear here.
Paste text and click Convert Text, or use Ctrl+Enter.
Your text stays private. All conversion happens locally in your browser using JavaScript. Nothing is uploaded to any server.

Choose strings, numbers, booleans, or null, then copy or download pretty-printed or minified JSON. Everything runs securely in your browser — nothing is uploaded.

How It Works

How to use the Text to JSON Array Converter

  1. Paste your values

    Paste values or upload a TXT file. Split the input by new line, comma, semicolon, tab, space, or a custom delimiter; the badge confirms Valid JSON as you type.

  2. Choose pretty or minified

    Pretty for files a person will read and diff. Minified for request bodies and anywhere bytes matter.

  3. Decide whether types are inferred

    Strings quotes everything, which is always safe. Auto emits real JSON numbers, booleans and nulls where the value matches.

Examples

Text to JSON Array Converter examples

A pretty-printed JSON array

Input

pending
approved
archived

Output

[
  "pending",
  "approved",
  "archived"
]

Minified for a request body

Input

pending
approved
archived

Output

["pending","approved","archived"]

Real JSON types

Input

1
2.5
true
null
draft

Output

[
  1,
  2.5,
  true,
  null,
  "draft"
]

With Value type on Auto. On Strings every entry would be quoted, including "true" and "null".

Notes

Working with text to JSON array

What makes JSON strict

JSON allows double quotes only, forbids trailing commas, has no comments and has no undefined. A JavaScript array literal can break all four rules and still run. That is why output here goes through JSON.stringify rather than being assembled by hand — the specification does the escaping, including the escape sequences for control characters.

Quoted numbers are a real decision

["1", "2"] and [1, 2] are both valid JSON and mean different things to whatever consumes them. Schema validators reject the wrong one, and JavaScript will happily turn "1" + 1 into "11". Choose Auto when the values genuinely are numbers; leave Strings on for IDs, ZIP codes and phone numbers, where a leading zero matters.

JSON arrays versus JavaScript arrays

Every JSON array is a valid JavaScript literal; the reverse is not true. If you are pasting into a .js file, the JavaScript Array Converter lets you pick single quotes or a const declaration. If the output goes into a .json file, an API request, or a config a parser will read, it has to be strict JSON.

FAQ

Text to JSON Array Converter FAQs

Create valid JSON from your text

Paste values or upload a TXT file above to build the JSON you need. Already have an array and need plain values instead? Use the Array to Text Converter.