JSON Formatter Online

Format, inspect, query, validate, redact, and profile JSON locally in your browser.

Input JSON0 B
Output
Waiting for input0 nodes0 objects0 arraysdepth 00 duplicate occurrences

Paste JSON or open a file to begin.

Shortcuts: Ctrl/Cmd+Enter format · Ctrl/Cmd+Shift+M minify · Ctrl/Cmd+Shift+C copy output

Private JSON Formatter, Validator, Tree Viewer, and Workbench

This JSON workbench formats strict RFC 8259 JSON without uploading the document to an application server. Use it to inspect API responses, configuration files, webhook payloads, JSON Lines logs, and test fixtures.

Unlike formatters that immediately turn the document into a JavaScript object, this tool formats the original syntax tree. That matters when a document contains a large integer, a high-precision decimal, unusual string escapes, or duplicate property names: formatting preserves the original tokens and reports risks instead of silently changing them.

Format, Minify, and Sort JSON

  1. Paste JSON, drop a file, select Open, or load the sample.
  2. Choose two spaces, four spaces, or tabs.
  3. Select Format to create readable output or Minify to remove unnecessary whitespace.
  4. Enable Sort keys when you need deterministic object ordering for fixtures or source-control diffs. Array order is never changed.
  5. Copy, download, or explicitly choose Use as input. Transformations never overwrite the source automatically.

Formatting also validates syntax. Errors include a line and column; selecting an error jumps to its position in the editor. Live validation runs for ordinary documents, while large documents wait for an explicit action to keep typing responsive.

Code View and Interactive Tree View

Code shows the exact formatted text. Tree gives you a virtualized navigator for large nested documents:

  • Search keys, values, or paths.
  • Expand or collapse individual containers.
  • Copy a value, RFC 9535 JSONPath, or RFC 6901 JSON Pointer.
  • Inspect each value's JSON type and full breadcrumb.

Expand All is disabled above 5,000 nodes to avoid freezing the browser. The tree initially opens only the root level.

Duplicate Keys and Numeric Precision

Object names should be unique. A document such as {"role":"user","role":"admin"} is syntactically accepted by many parsers, but different programs may keep different values. This tool preserves both properties, marks their paths as ambiguous, and blocks features that would have to collapse them.

JavaScript cannot exactly represent every valid JSON number. For example, 9007199254740993 is outside the safe integer range and is commonly rounded to 9007199254740992. The formatter preserves the original number text and shows a warning. JSONPath, Schema, and Profile are disabled when converting the document into normal JavaScript values could change its meaning.

Query JSON with RFC 9535 JSONPath

Open Query to extract values and their normalized paths. Examples:

  • $.users[*].name selects every user name.
  • $..email finds email values at any depth.
  • $.items[[email protected] < 10] filters inexpensive items.
  • $.records[0:5] selects an array slice.

Query evaluation follows RFC 9535 and does not use dynamic JavaScript evaluation.

Validate with JSON Schema

Open Schema to validate the current document against either JSON Schema Draft-07 or Draft 2020-12. Results include the instance path, schema path, failed keyword, and message. Validation does not coerce types, insert defaults, or remove fields.

For privacy and predictable behavior, remote $ref URLs are not fetched. Local references such as #/$defs/address work; external schemas need to be inlined first.

Work with JSONL and NDJSON

The JSONL tab treats every nonblank line as a separate JSON value. It reports valid and invalid record counts and the line containing each error. You can convert valid JSONL/NDJSON into a JSON array, or convert a root JSON array into one compact record per line.

Files ending in .jsonl or .ndjson open directly in this mode.

Redact Secrets Before Copying

Select Redact to scan property names commonly used for passwords, tokens, API keys, authorization headers, cookies, private keys, and client secrets. Review every match, add project-specific key names, and create a redacted output where selected values become "***REDACTED***".

Redaction changes only the generated output. The source editor remains untouched so you cannot accidentally overwrite the original payload.

Profile API Response Shapes

The Profile tab analyzes a root or nested array of objects. It reports each field's presence, missing and null counts, observed types, and a few example values. This is useful for spotting optional fields, inconsistent types, and null-heavy API responses before defining application types or a JSON Schema.

Document Statistics and Large Files

The status bar reports UTF-8 size, node, object, and array counts, maximum depth, duplicate properties, and numeric warnings. Parsing and analysis run in a background browser worker.

  • Live validation runs up to 1 MiB.
  • A warning appears above 10 MiB.
  • Input above 25 MiB is rejected to protect the browser tab.

For substantially larger data, use a streaming command-line tool such as jq rather than any browser formatter.

Keyboard Shortcuts

ShortcutAction
Ctrl/Cmd + EnterFormat JSON
Ctrl/Cmd + Shift + MMinify JSON
Ctrl/Cmd + Shift + CCopy output

Privacy and Scope

The JSON, schema, query, profile, and redacted output stay in this browser tab and are not stored in local storage or included in analytics requests. The site itself may load privacy-respecting analytics, but payload content is never sent with those requests.

This tool deliberately diagnoses malformed JSON instead of guessing how to repair it. It does not create cloud share links, fetch authenticated URLs, or save document history. Those choices keep transformations explicit and sensitive payloads under your control.

Related Developer Tools

Feedback