# JSONL to array

`jsonl-to-array` · version 1.0.0 · JSON & JSONL · free, no key needed

Parse strict JSON Lines text into an array of JSON-safe values.

**Use when you need to: jsonl to array · parse json lines into an array · convert jsonl to json array.**

## Supported

- jsonl to array
- parse json lines into an array
- convert jsonl to json array

## Not supported

- JSONL comments
- NDJSON with blank lines
- concatenated JSON without newlines
- streaming parse
- read files

## Behavior

- text is strict JSON Lines split on CRLF, CR, or LF.
- A trailing empty segment after a final newline is ignored; internal empty lines are rejected.
- Empty text or only a trailing newline yields an empty values array.
- At most 5000 lines are accepted.
- Each line is parsed with JSON.parse and must be a JSON-safe value: object, array, string, boolean, null, or safe integer.
- Parsed objects are rebuilt with a null prototype; prototype-like own keys are ordinary keys.
- Output values appear in file order.

## Input

- `text` (string, required): max length 256000

## Output

- `values` (array of any, required): max items 5000

## Limits

- max input bytes: 256000
- max lines: 5000

## Example

Request input:

```json
{
  "text": "{\"name\":\"Ada\",\"ok\":true}\n\"שלום\"\n0\nnull\n"
}
```

Response:

```json
{
  "result": {
    "values": [
      {
        "name": "Ada",
        "ok": true
      },
      "שלום",
      0,
      null
    ]
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "jsonl-to-array",
  "version": "1.0.0",
  "input": {
    "text": "{\"name\":\"Ada\",\"ok\":true}\n\"שלום\"\n0\nnull\n"
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/jsonl-to-array/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"text":"{\"name\":\"Ada\",\"ok\":true}\n\"שלום\"\n0\nnull\n"}'
```

The machine-readable contract is at [/v1/tools/jsonl-to-array/versions/1.0.0](/v1/tools/jsonl-to-array/versions/1.0.0).

### CLI

```sh
node cli.mjs run jsonl-to-array 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [Array to JSONL](/tools/array-to-jsonl): Serialize an array of JSON-safe values as JSON Lines text.
- [JSON array index by](/tools/json-array-index-by): Convert an array of objects into a single object indexed by a specific key.
- [JSON flatten](/tools/json-flatten): Flatten a JSON value into a null-prototype map keyed by RFC 6901 JSON Pointers.
- [JSON to CSV](/tools/json-to-csv): Serialize string-valued JSON rows to CSV using explicit ordered columns.
- [JSONL validate](/tools/jsonl-validate): Validate strict JSON Lines text and report the value count and UTF-8 byte length.
- [JSON array anti join](/tools/json-array-anti-join): Anti join two JSON arrays of objects on exact keys.
