input.json · editing
output.json · 2-space
Repair fixes single quotes, unquoted keys, trailing commas, Python literals, and more.

Repair the syntax before you format it

A formatter cannot pretty-print text it cannot (re)parse. This tool does the previous, messier step: it parses common “almost JSON” syntax, converts it to strict JSON where the intended structure is unambiguous, and formats the output for review.

This makes it useful for JavaScript object literals copied from source code, Python-style dictionaries in logs, hand-edited config files, or AI responses wrapped in Markdown fences. A common formatter would stop at the first single quote or trailing comma. Repair & Format aims to normalize the entire document.

Mistakes the repair pass understands

  • single-quoted strings such as 'Ada';
  • unquoted object keys such as { name: "Ada" };
  • trailing commas before } or ];
  • True, False, and None copied from Python;
  • JavaScript line and block comments;
  • Markdown code fences around a JSON response;
  • hexadecimal numbers such as 0xFF.

Repair is intentionally tolerant. The JSON Validator is intentionally strict. Use them together.

A reliable repair workflow

  1. Remove credentials and reduce the input to the smallest sample that still fails.
  2. Choose Repair & Format and compare the output with the input.
  3. Check every place where the tool made an interpretive change, especially strings, numbers, and null values.
  4. Run the strict validator on the repaired text.
  5. Validate the result against your application's schema or API contract before sending it anywhere important.

Consider this broken input:

{
  user: 'Ada',
  active: True,
  roles: ['admin',],
}

The syntax strongly suggests an object with three fields, so the repair is low-risk: quote the key names and strings, convert the Python boolean, and remove the final commas. A missing value is different. Given { "limit": }, no general-purpose tool can know whether the author meant 0, null, an empty string, or something else.

Syntax repair is not data validation

Even valid JSON may be invalid for the system consuming it . You might have to keep a user id as a string to keep the leading zeroes. A date might be valid text but in the wrong time zone. Each comma is correctly placed, but an extra property might change authorization behavior.

After parser accepts document, check required fields, types, allowed values, array lengths, null handling and unknown keys. For permissions, billing, deletion, or other high-impact actions, compare the repaired payload to a known-good example or to a formal schema.

Local processing, with sensible precautions

The editor and repair engine run in your browser; the pasted document does not need to be uploaded to a fixjson.org application server for processing. Page hosting and analytics are separate from the editor workflow and are described in the Privacy Policy.

Sanitizing a debugging sample is still good engineering, although local processing reduces exposure. Do not paste secrets, tokens, customer data, or production identifiers into any website.