JSON

Fix JSON without silently changing the data

Find syntax errors, duplicate keys and oversized numeric IDs before treating formatted output as trustworthy.

A reproducible software example using fictional data. Source references and conversion limits are included below.

Pretty indentation helps you read JSON. It does not prove that the data is correct for your application. A useful first check separates syntax, ambiguity and application rules. SyntaxPad checks the first two and leaves the application’s schema decisions to you.

Start with valid structure

{"order":"SP-1042","customer":{"postal_code":"00123"},"paid":true}

Load the example in JSON Formatter, choose two-space indentation and run the formatter. Expand the tree preview to inspect the customer object. The postal code stays a string and paid stays a boolean. Choose compact output when you need a single line; this changes whitespace, not the data model.

Repair one error at a time

{"order":"SP-1042", "paid":true,}

The trailing comma is not valid JSON. Remove it and run again. The tool reports a line and column near the problem, but an earlier missing quote can make a later position look wrong. Inspect the surrounding characters instead of adding punctuation blindly. JSON strings and object keys require double quotes; comments and unquoted property names are not accepted.

Duplicate keys are a data decision

{"status":"pending","status":"paid"}

Many parsers retain the last value. That behavior can hide a conflict. SyntaxPad rejects this object and asks you to choose one value or represent both states explicitly in an array. It cannot infer which status is authoritative. Reformatting should never make that decision for you.

Keep long identifiers exact

{"external_id":9007199254740993}

This integer is beyond JavaScript’s safe-integer range. Treating it as a regular number can change its digits. SyntaxPad rejects unsafe integer values and numeric literals that cannot round-trip to the same decimal value through its number representation. If this value is an identifier, use "9007199254740993". If it is a mathematical quantity, use software designed for the precision your workflow needs.

Ordinary decimal values still use JavaScript numbers internally. This tool is not an arbitrary-precision calculation engine. Numeric spelling may normalize, such as 1.0 becoming 1; numeric value and original source text are different goals.

What a successful result establishes

The output is syntactically valid JSON within the documented size and depth limits. It does not establish that an email exists, a date is valid, a price is reasonable or a required field is present. Check those against the receiving application’s contract. Use fictional examples while exploring, and review the entire result before replacing your source file.

References: RFC 8259: JSON objects and numbers; JavaScript safe integers.

Try the same steps

Open JSON Formatter and load the example to get started.