Files are read locally by your browser. Nothing is uploaded, stored, or sent to a backend.

Paste a JSON array, or open a local .json, .txt, or .log file.

No file selected. Paste JSON above or open a local file.

- Converted NDJSON -

Valid JSON will be converted into compact newline-delimited JSON. If the input cannot be parsed, the error will appear below.

Waiting for JSON.
0 output lines
None input type
0 top-level array items

Nothing converted yet

Paste JSON above, open a local file, and choose Convert to NDJSON. The converted output will appear here.

What does this converter do?

This converter turns a JSON value into newline-delimited JSON.

Most often, that means turning a JSON array like this:

[
  { "level": "info", "message": "Started" },
  { "level": "warn", "message": "Slow response" },
  { "level": "error", "message": "Something failed" }
]

into NDJSON like this:

{"level":"info","message":"Started"}
{"level":"warn","message":"Slow response"}
{"level":"error","message":"Something failed"}

Each item in the original array becomes one compact JSON line.

When is JSON to NDJSON useful?

Regular JSON arrays are useful for APIs, configuration, fixtures, and documents that are meant to be loaded as a complete value.

NDJSON is useful when records need to be handled one at a time.

That makes NDJSON helpful for:

  • logs
  • exports
  • command-line tools
  • streaming data
  • large record sets
  • search indexing
  • queue-style processing
  • data pipelines

In practical terms, JSON arrays are often good for passing data around as one object. NDJSON is often good for processing records line by line.

How this converter works

This converter keeps the process intentionally simple:

  1. It reads your JSON input.
  2. It parses the input as JSON.
  3. If the top-level value is an array, each array item becomes one NDJSON line.
  4. If the top-level value is not an array, the value is converted into one NDJSON line.
  5. It reports the input type, output line count, and any parse error.

The output is compact by design. NDJSON expects one JSON value per line, so each record is written on a single line. After if you would like to improve the formatting, you can check out my ndjson formatter or if you're working with a lot of NDJSON files, the Siteimp log workbench is a great choice with the same privacy protections as built into this site and it uses localStorage so you can keep multiple files open and compare them.

Privacy and local files

This page runs in your browser. There is no account, no backend upload, and no server-side storage.

If you open a local file, your browser reads the file so this page can convert it. The file is not uploaded to hluska.ca.

If you refresh or close the page, the current input and output are gone. That is intentional.

Want to test that?

After this page loads, turn off your internet connection and try using the converter. It will still work because this tool was designed to be local first.

You can also open your browser developer tools, check the Network tab, and then convert a file. Again, if the file gets uploaded anywhere, I have made a really big mistake... please contact me.

That does not mean every browser tool is safe. It just gives you a practical way to check what this page is doing.

Before sharing converted data

Converting JSON to NDJSON changes the shape of the data. It does not automatically make the data safe to share.

Before sending converted data to another person or company, check for values such as:

  • tokens
  • secrets
  • passwords
  • email addresses
  • usernames
  • file paths
  • machine names
  • internal URLs
  • customer data
  • session IDs
  • API keys

Unless you have strong protections in place, including legal and data sharing documents where appropriate, you will usually be better off copying only the records you need. Or remember, the web is not the only way to run software and you can often find tools you can install on your own infrastructure so you can control whatever machine your data touches.

Other Tools

About Tools

Greg built every tool on hluska.ca to run locally in the browser with no backend. This means your data is never sent anywhere - it stays on your device. These tools are designed for practical use, primarily for Greg's personal use and so they reflect his tastes and needs. They're not polished products, some are rough around the edges and others will prove to be horrible mistakes. But web development wouldn't be so fun and glamourous if you didn't occasionally embarrass yourself in public.