Developer Security

JSON Formatter & Validator

Paste JSON from a SOC alert, security API response or log entry to format it for readability, minify it for storage, or validate it and get a precise error location.

JSON is parsed and formatted entirely in your browser using the native JSON API -- nothing is sent to a server, so it's safe to paste sensitive alert or log data here.

What this tool does

This tool formats messy or minified JSON into readable, indented output, compresses formatted JSON down to a single line, and validates JSON syntax with a specific error location when parsing fails. It also reports quick structural stats: character size, total key count and maximum nesting depth.

Why security professionals use it

JSON is everywhere in modern security tooling: SIEM alert payloads, EDR API responses, webhook notifications, and structured log exports. Being able to quickly pretty-print a raw alert to read its fields, or validate that a webhook payload is well-formed before debugging an integration, saves significant time during triage and tool development.

How it works

The tool relies on the browser's built-in JSON.parse and JSON.stringify. Formatting re-serializes the parsed object with your chosen indentation; minifying re-serializes it with no whitespace. When parsing fails, the browser's error message (which often includes a character position) is translated into a line and column so you can find the problem quickly.

Step by step

  1. 1Paste your JSON -- raw, minified, or already formatted -- into the input box.
  2. 2Choose an indent width if you plan to format.
  3. 3Click Format, Minify or Validate depending on what you need.
  4. 4If there's a syntax error, use the reported line/column to find and fix it in your source.
  5. 5Copy the result once you're happy with it.

Practical examples

Pasting a single-line SIEM alert like {"alert":"Brute force","src_ip":"10.1.1.5","count":42} and clicking Format expands it into readable, indented JSON -- much easier to review than a dense one-liner in a terminal.

Pasting formatted JSON with a trailing comma or missing quote and clicking Validate immediately flags the exact line and column of the problem, instead of you scanning the whole payload by eye.

Common mistakes

  • Confusing JSON with JavaScript object literals -- trailing commas, unquoted keys and single quotes aren't valid JSON.
  • Assuming minified JSON is 'broken' just because it's unreadable -- use Format first before assuming there's an error.
  • Not checking key count/depth stats, which can hint at unexpectedly deep or bloated payloads worth investigating.
  • Pasting JSON with embedded comments (not valid in standard JSON) and being confused by the parse error.

Security considerations

This tool only parses and re-serializes JSON text; it does not execute any code found inside the data, so it's safe to use on untrusted alert payloads. That said, treat any JSON containing personal data, credentials, or sensitive log content the same way you would any other sensitive document -- this tool runs client-side and doesn't transmit data, but your browser tab and clipboard are still part of your device's security boundary.

Frequently asked questions

Why does Validate not change my formatting?

Validate checks syntax and reports stats without altering the layout, so you can confirm well-formed JSON without losing your original formatting choices.

Can this handle very large JSON payloads?

Yes, within the limits of your browser's memory -- it uses the native JSON parser, which is fast and works well for typical alert and log payloads.

Does it support JSON Lines (one JSON object per line)?

This tool expects a single JSON value. For JSON Lines logs, format each line individually, or use the Log Analyzer tool which detects JSON-lines formatted logs.

What does 'depth' mean in the stats?

Depth is the maximum level of nested objects or arrays in your JSON. A flat object with no nested objects has a depth of 1; deeply nested alert metadata can have much higher depth.