What is NDJSON?
NDJSON stands for newline-delimited JSON. Instead of storing one large JSON array, an NDJSON file stores one JSON value per line.
That makes it useful for logs, exports, streamed data, and other situations where programs need to write records one at a time.
A tiny NDJSON file might look like this:
{"level":"info","message":"Started"}
{"level":"warn","message":"Slow response"}
{"level":"error","message":"Something failed"}
Each line is separate JSON. That is great for programs, but it can be awkward for humans to read when the file gets large.
How this formatter works
This formatter keeps the process intentionally simple:
- It splits the text into lines.
- It skips empty lines.
- It parses each line as JSON.
- It pretty-prints valid lines.
- It shows the original line and parser error for invalid lines.
One broken line should not hide the rest of the file. That is one of the nice things about NDJSON: each line can be inspected on its own.
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 format it. The file is not uploaded to hluska.ca.
If you refresh or close the page, the current input is gone. That is intentional.
Want to test that?
After this page loads, turn off your internet connection and try using the formatter. If it still works, that tells you the formatting is happening in your browser.
You can also open your browser developer tools, check the Network tab, and then format a file. You should not see the file being uploaded anywhere.
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 formatted data
Formatting makes NDJSON easier to read. It does not make logs or exported data safe to share.
Before sending formatted 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 type documents) to justify sending everything, you will be better off and far more secure if you only copy what you need. Alternately if you're a little more advanced and don't mind digging deeper into these files, you can (and should) start learning about sanitizing data.