Format JSON Logs Online — NDJSON & JSON Prettify

Pretty-print a JSON log document or compact NDJSON lines in your browser. Indent applies to single documents only — all processing stays local.

Loading…
JSON log formatter — document or NDJSON
Beautify one JSON blob or normalize multi-line NDJSON to compact one-JSON-per-line output. Processing stays in your browser.

Developer notes

• Uses JSON.parse + JSON.stringify only (no silent beautify catch). • Single-document mode when the whole paste parses as one JSON value. • Multi-record mode: one compact JSON object/array per non-empty line. • Indent applies to single-document mode only. • CRLF is normalized to LF before parsing.

Options

Indent
Spaces (2 or 4) used when pretty-printing a single JSON document. Ignored in multi-record NDJSON mode.

When teams pick this route

• Pretty-print a pasted application log object for reading. • Normalize messy NDJSON exports before sharing. • Convert pretty multi-line dumps back to one-line-per-event streams. • Pair with filter-json-logs for triage.

Worked examples

Rich single JSON document

Before

{"ts":"2026-07-12T10:01:22.104Z","level":"info","service":"checkout-api","traceId":"a1b2c3d4e5f6","msg":"request completed","http":{"method":"POST","path":"/v1/orders","status":201,"durationMs":42},"user":{"id":"usr_9182","plan":"pro"},"meta":{"region":"eu-west-1","build":"1.8.15","features":["payments","inventory"]}}

After format

{ "ts": "2026-07-12T10:01:22.104Z", "level": "info", "service": "checkout-api", "traceId": "a1b2c3d4e5f6", "msg": "request completed", "http": { "method": "POST", "path": "/v1/orders", "status": 201, "durationMs": 42 }, "user": { "id": "usr_9182", "plan": "pro" }, "meta": { "region": "eu-west-1", "build": "1.8.15", "features": [ "payments", "inventory" ] } }

Multi-line NDJSON (indent ignored)

Before

{"a":1} {"b":2}

After format

{"a":1} {"b":2}

Navigate related log tools

Filter events with filter JSON logs, validate streams via validate NDJSON, or open the logs hub. For single-document JSON see JSON formatter.

JSON log formatter FAQ

Document vs NDJSON

Why does indent not change NDJSON output?

When multiple JSON records are detected, output stays compact one-JSON-per-line (true NDJSON). Indent only applies when the whole paste is a single JSON document.

How is this different from JSON formatter?

JSON formatter targets one document. This tool also handles line-oriented NDJSON and documents the multi-record path honestly.

What are the size limits?

1 MiB per paste and at most 20 000 non-empty lines for format/filter. Oversized input returns an error instead of truncating.

More log tools in this cluster

Looking for converters, encoders, formatters, and minifiers in one place? Developer tools hub Open the curated developer tools catalogue.