DEVELOPER TOOLS

JSON Formatter & Validator

Highly recommended

Format, check, and explore JSON locally. Numbers, property order, and duplicate keys are preserved.

Input

Output

Object properties —Container depth —Input UTF-8 bytes 0Output UTF-8 bytes 0
Explore JSON tree

Expand containers to inspect values. Each branch shows up to 100 entries; the viewer shows up to 1,000 entries in total. Full output is unaffected.

Formatting rules & limits

Formatting changes whitespace only. Exact number tokens, escaped strings, property order and duplicate keys are kept. Duplicate keys are flagged because applications may interpret them differently. Comments, trailing commas, single-quoted strings and non-finite numbers are not valid JSON.

Any JSON value is accepted, including strings, numbers, booleans and null. Property counts exclude array indexes. Depth counts nested objects and arrays; a primitive has depth zero.

Limits: 1,000,000 input UTF-16 units, 50,000 values, 128 nested containers, and 4,000,000 output units. Files must be at most 4 MB. Errors include a line and column where parsing stopped. Text stays in page memory and is not saved or uploaded.

Using JSON Formatter

Make JSON easier to read, reduce whitespace or diagnose syntax errors. Formatting preserves number tokens, string escapes, property order and duplicate keys.

  1. Paste JSON, open a local JSON file or load the example.
  2. Choose two spaces, four spaces or compact output, then format or validate.
  3. Read any error or duplicate-key warning, inspect the tree, and copy or download valid output.

Example

Input: {"id":9007199254740993,"active":true}
Formatted output keeps the exact id 9007199254740993; it is not rounded.

Questions & answers

Does formatting round large numbers?

No. The formatter preserves the original number tokens, including large integers, exponent notation and negative zero. It changes whitespace rather than reserializing JavaScript numbers.

Why does JSON with comments or trailing commas fail?

Standard JSON does not allow comments, trailing commas or single-quoted strings. The error shows the line and column where parsing stopped.

What happens to duplicate property names?

They remain in their original order and trigger a warning. Applications may interpret duplicates differently, so check them before using the JSON.

Why does the tree show fewer entries than the output?

The viewer loads up to 100 entries per branch and 1,000 entries in total for responsiveness. The complete formatted output is independent of those display limits.

Guides for this tool

Examples and checks to help with your next step.

Help improve this tool

Report a problem or suggest an improvement

Describe the issue without pasting private tool input. Feedback goes to our admin inbox.

Find another tool · Read practical guides