Tools · NDJSON

# JSON to NDJSON

One object per line, nothing flattened. An array becomes its lines; an object with a list inside becomes that list, with the rest of the object on every line.

no signup · runs entirely in your browser · ⌘V works anywhere on this page

JSON to NDJSON — A paginated list opens as a tree; Convert, NDJSON writes one object per line — the list unwound, the Foot measures the result. · 10 s

## What you get

- Writes the paginated list as 3 lines — one per object in data, the page fields on each
- Writes the order sample as 2 lines — its items, with the order on every line
- Keeps every value as it was: nested objects stay nested, numbers stay numbers, nothing is flattened or renamed
- Copies or downloads the .ndjson; opens the same text in the app for the tree and the rest

## What it will not do

- Guess which list is the rows when a document holds several — it says so and asks you to focus a branch in the app.
- Flatten. A nested object stays a nested object on its line; a stream reads it back as it was.
- Send your text anywhere. The page is static and the engine runs in this tab — open the network panel and watch it stay empty.

## What becomes a line

{"page":1,"data":[{"id":1},{"id":2}]}{"id":1} {"id":2}

{ "id": 1, "ok": true }{"id":1,"ok":true}

Stays nested on its line — NDJSON is JSON per line, so nothing is flattened.

## The sample

What the first sample opens — a real file, not an illustration written for this page.

```
{
  "object": "list",
  "url": "/v1/charges",
  "has_more": false,
  "data": [
    {
      "id": "ch_3PZ3xJ2eZvKYlo2C0Ab1cDe2",
      "amount": 17054,
…
```

## in VS Code

Convert, then NDJSON — from a document, a selection or a rows file, into a new editor.

## Questions

### What is NDJSON?

Newline-delimited JSON: one complete JSON value per line, no commas between them and no outer brackets. JSON Lines and .jsonl are the same thing under another name.

### My JSON is an object, not an array. What happens?

Its main list becomes the lines and the rest of the object rides on every line — a paginated response with a data array converts to one line per item, each carrying the page fields.

### Can I go the other way?

Yes — the NDJSON to JSON page reads lines back into one array, and names any line that will not parse.

## Behind this page

## Try it on the file that broke your afternoon.

free while in alpha · no signup

---

Canonical: https://unstringify.com/tools/json-to-ndjson
