# JSON Lines Converter

Canonical: https://herebetools.com/json-lines

Convert JSON arrays to JSON Lines (JSONL/NDJSON) and back with line-specific errors

Use JSON Lines to prepare newline-delimited records for logs, data exports, and processing pipelines. Each JSON array item becomes a compact JSON value on its own line. The reverse conversion skips blank lines and reports the source line when JSON is invalid. Conversion uses the browser’s native JSON parser, including JavaScript number precision limits.

## Questions and answers

### Does each line have to contain a JSON object?

No. Each nonblank line can contain any valid JSON value, including an object, array, string, number, boolean, or null.

## Related tools

- [JSON Formatter](https://herebetools.com/json-formatter): Format, validate, minify and sort JSON with tree view
- [JSON Compare](https://herebetools.com/json-compare): Diff two JSON documents side by side
- [CSV ↔ JSON](https://herebetools.com/csv-json): Convert between CSV and JSON with type detection

Tool processing runs in your browser.

## How to use it

1. Choose JSON array to JSON Lines, or JSON Lines to JSON array.
2. Paste input or open a local .json, .jsonl, or .ndjson file up to 10 MB.
3. Convert, check any reported line error, then copy or download the result.

## Example

Input:

```text
{"id":1}
{"id":2}
```

Output:

```text
[
  {
    "id": 1
  },
  {
    "id": 2
  }
]
```

## Behavior and limits

The importer skips blank lines and removes a leading byte-order mark as conveniences. It is not a strict JSON Lines conformance checker. Numbers use JavaScript JSON precision; files must fit in browser memory.

## Sources and specifications

- [RFC 8259 — JSON](https://www.rfc-editor.org/rfc/rfc8259)
- [JSON Lines format documentation](https://jsonlines.org/)

[Privacy policy](https://herebetools.com/privacy-policy) · [About](https://herebetools.com/facts) · [Topics](https://herebetools.com/topics)
