Skip to developer tool
DEVELOPER TOOLKIT · JSON

JSON Formatter & Inspector

Format, validate, explore and safely transform JSON in your browser. Number tokens stay exact and duplicate keys stay visible.

No uploads · No account · Import → Inspect → Export

JSON Studio

Source and result are kept separately. Edits never auto-overwrite source.

Ready. Paste JSON or open a file.
Untitled · 0 characters
Not formatted

Syntax and integrity

Validate to inspect syntax and representation warnings.

This is strict JSON analysis, not schema validation or RFC 8785 canonicalization. Duplicate keys and numeric tokens are retained during ordinary formatting; converting to JavaScript numbers can still lose precision. No pasted data is saved or uploaded.

How to use JSON Formatter & Validator

  1. Paste JSON or load a local .json file. Choose pretty printing, compact output or sorted object keys.
  2. Choose indentation and optionally escape HTML-sensitive characters when preparing JSON for an HTML script context.
  3. Format in a local worker, inspect errors, numeric tokens and duplicate member names, then copy or download the result.

When to use this tool

Inspect a compact API response, find a JSON syntax error or prepare a readable configuration file. Formatting validates syntax, not the business rules or schema required by an application.

Formatting changes representation, not JSON value types

JSON strings, numbers, booleans, arrays, objects and null have defined syntax. Comments and trailing commas are not standard JSON. Sorting uses a code-unit comparison, including numeric-looking names; it is not RFC 8785 canonical JSON. The embedding option escapes characters such as < as Unicode escapes so a string containing a closing script tag is not emitted literally.

Worked example

Input: {"z":1,"a":"</script>"}
Sorted and HTML-sensitive escaping:
{"a":"\u003c/script\u003e","z":1}
Whitespace depends on the selected mode.

Keep exact identifiers as strings while formatting JSON

{"id":"9007199254740993","tags":["z","a"],"active":false,"count":0}
  1. Paste this authored input and choose Beautify with the intended indentation. The large identifier is quoted deliberately. Unquoted out-of-range number tokens are preserved and flagged, but other JSON consumers may round them.
  2. Choose Sort object keys when a documented code-unit ordering helps review. Arrays remain in their original order; duplicate object names block sorting.
  3. Check that false, zero and the quoted identifier still express the intended types. Pretty printing is not validation against your application's required fields.
  4. Copy or download the formatted JSON. Retain the original bytes separately if whitespace, original ordering or an external signature matters.

Authored JSON, no output artifact supplied. HTML-sensitive escaping changes JSON representation; it is not a general HTML sanitizer. Use JSON Diff for a separate comparison, or JSON Schema Validator for a supported schema check.

Limits and output checks

The V2 parser retains unsafe numeric tokens verbatim and warns about precision risks instead of rounding them. Exact identifiers are still best represented as strings. Escaped output is still JSON, not an HTML or URL sanitizer; validate the surrounding embedding context separately. Worker deadlines and text limits apply.

Reference: JSON syntax and parsing.

Frequently asked questions

Will this repair invalid JSON?

No. It reports parser errors instead of inventing missing values, removing comments or guessing punctuation. JSON Lines is a separate, explicit document mode.

How are large integers handled?

V2 preserves numeric spellings with a token parser and warns when JavaScript Number would lose precision. Use quoted strings for exact identifiers that may be consumed by other apps.

Does escaping change a string value?

No. JSON Unicode escapes represent the same characters when parsed. The source representation changes, which is useful in an appropriate HTML embedding context.

JSON inspection and safe developer handoff

Duplicate keys and numeric accuracy

JSON objects can contain repeated member names, but applications disagree about which value survives. This inspector reports duplicates and keeps the original occurrences in ordinary pretty/minified output; key sorting, subtree extraction and redaction are blocked when ambiguity remains. Number spellings such as 9007199254740993, -0 and 1e400 are retained exactly, with warnings about JavaScript Number conversion. An external parser or database may still impose its own numeric limits.

Explore JSON Pointer paths and redact deliberately

After validating one JSON document, open the Tree tab, browse a branch or search for a value, and copy its RFC 6901 JSON Pointer. Extracting or redacting a selected path produces a new result without modifying the source. Review and download the redacted result intentionally before sharing; this is not automatic detection of other sensitive values.

JSON vs JSON Lines

Normal JSON holds one complete value, including a scalar, object or array. JSON Lines (NDJSON) contains one JSON value on each line. Blank records are rejected by default; skipping them requires checking the explicit option and is reported. Batch export is bounded to 30 files and 16 MiB of input, and only verified successful results are added to an export ZIP.

Sorting is not canonicalization or schema validation

Sort Object Keys applies code-unit ordering to object member names while keeping array order. It is not the RFC 8785 JSON Canonicalization Scheme, does not prove signature equivalence, and does not validate business rules or a JSON Schema. HTML-sensitive escaping changes source representation only; it does not sanitize arbitrary active HTML.

A practical workflow

Format a copied JSON response to inspect its structure, then use a schema validator when you need to check required fields and value types.

Read the scope alongside the result

Formatting does not repair invalid JSON or prove that data meets an application contract. Exact large identifiers should retain their intended string representation.

Related next steps

All developer tools · Privacy policy · Contact PixelOkay