JSON Log Viewer

Parse line-based logs and inspect JSON entries.

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:

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

  1. Copy the log output you want to inspect — one JSON object per line — and paste it into the Input box above.
  2. Click Run.
  3. Read the Output box: it contains a JSON array with one entry per non-empty input line, each tagged ok: true with its parsed data, or ok: false with an error message.
  4. Scroll through the array to find any ok: false entries — the line field tells you which line in your original paste to go fix, and the error field tells you why it failed.
  5. 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

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