What This Tool Does
The JSON Log Viewer reads your input as JSON Lines (also known as JSONL or NDJSON) — a format where every non-empty line is treated as its own, independent JSON value. This is the format many services use for structured logging, since each log event can be written out and flushed the moment it happens, without waiting to close a wrapping array.
Instead of trying to parse the whole input as one JSON document (which would fail the instant a single line has a typo), this tool parses each line separately and builds a JSON array describing the result of every line:
- Valid lines become
{ "line": N, "ok": true, "data": <parsed value> } - Invalid lines become
{ "line": N, "ok": false, "error": "<parser message>" }
Because each line is isolated, one malformed entry never breaks the entire view — you get a complete report showing exactly which lines parsed successfully and which failed, along with the reason for each failure. Line numbers are assigned to non-empty lines only; blank lines are stripped out before numbering, so a blank line in the source never shows up as an entry in the output.
How to Use It
- Copy the log output you want to inspect — one JSON object per line — and paste it into the Input box above.
- Click Run.
- Read the Output box: it contains a JSON array with one entry per non-empty input line, each tagged
ok: truewith its parsed data, orok: falsewith an error message. - Scroll through the array to find any
ok: falseentries — thelinefield tells you which line in your original paste to go fix, and theerrorfield tells you why it failed. - Click Clear to reset both boxes and inspect a new batch of log lines.
Worked Example
Suppose your log file has three lines, and the second one is missing a closing brace:
{"level":"info","msg":"server started","port":3000}
{"level":"error","msg":"db connection failed"
{"level":"warn","msg":"cache miss","key":"user:42"}
Running it through the tool produces:
[
{
"line": 1,
"ok": true,
"data": { "level": "info", "msg": "server started", "port": 3000 }
},
{
"line": 2,
"ok": false,
"error": "Unexpected end of JSON input"
},
{
"line": 3,
"ok": true,
"data": { "level": "warn", "msg": "cache miss", "key": "user:42" }
}
]
Lines 1 and 3 parsed cleanly and carry their decoded objects in data. Line 2 failed because the missing closing brace left the JSON parser expecting more input — the tool reports it as ok: false without stopping the rest of the analysis, so you immediately know it's the "db connection failed" entry that needs fixing, and exactly why.
Note that the exact error message text (such as "Unexpected end of JSON input") comes from your browser's built-in JSON parser and can vary slightly between browsers, but it will always point at the same underlying problem.
Common Use Cases
- Inspecting structured application logs — many backend frameworks and logging libraries emit one JSON object per line by default; this tool lets you paste a chunk of that output and see it decoded and organized instantly.
- Debugging log ingestion pipelines — if a downstream log processor (like a log aggregator or ELK-style pipeline) is dropping or rejecting entries, running the same raw lines through this tool quickly reveals which specific lines are malformed JSON and why the pipeline is choking on them.
- Spot-checking exported NDJSON files — logging platforms and data warehouses commonly export data as newline-delimited JSON; pasting a sample here before a full import confirms the export isn't truncated or corrupted.
- Reviewing log samples during incident response — when triaging an outage, pasting in the relevant log window lets you quickly confirm every line is well-formed and see the decoded fields side by side without manually reformatting each line.
- QA on custom logging code — if you just wired up a new logger that writes JSON lines, running its output through this tool is a fast way to confirm every emitted line is syntactically valid JSON.
Frequently Asked Questions
What is JSON Lines / NDJSON?
JSON Lines (NDJSON) is a text format in which each line of a file is one complete, standalone JSON value, rather than the whole file being a single JSON document. It's popular for logging and streaming data because entries can be appended one at a time — a new line can be written the moment an event occurs, without needing to reopen and rewrite a wrapping array.
What happens with blank lines?
Blank lines are filtered out before the input is processed, so they never appear in the output and never take up a line number. The line value in each output entry reflects the position among non-empty lines only, not the raw line count in your original paste.
What does ok: false mean?
It means that specific line failed to parse as valid JSON. The tool keeps processing every other line regardless, and includes the parser's error message so you know exactly what went wrong on that line — a missing brace, an unquoted key, a trailing comma, and so on.
Is my data uploaded anywhere?
No. All parsing happens locally in your browser with JavaScript. Nothing typed or pasted into the input box is sent to a server, which makes this safe to use on internal or sensitive log data.
Can I use this to validate a JSONL export before ingesting it?
Yes. Paste the export's contents in and click Run. The output array shows you immediately which lines are valid JSON and which are not, so you can catch corruption or truncation before it reaches a database or pipeline.
Related Tools & Guides
- JSON Formatter & Prettifier — pretty-print a single JSON document once you've isolated the value you need from a log line.
- All JSON Tools — browse the full toolkit for converting, validating, and formatting JSON.
- Blog & Guides — read more in-depth guides on working with JSON, JSON Lines, and Toon data formats.