Repair Common JSON Syntax Mistakes
JSON is strict about quotes, commas, and delimiters, so a small formatting mistake can stop an otherwise useful payload from parsing. This JSON Repair tool applies a short list of clear syntax corrections to JSON-like text, then checks the result with a JSON parser. It shows the changes it made so you can review the repaired document before copying or downloading it.
Paste the text or open a local .json file and select Repair JSON. If the input is already valid, the tool reports that no repair was needed. If the remaining text cannot be parsed, it shows an error instead of presenting it as repaired JSON.
What This JSON Repair Tool Can Fix
| Input issue | Repair applied | Example |
|---|---|---|
| Comments | Removes line and block comments outside quoted strings | // note or /* note */ |
| Single-quoted strings | Converts single-quoted strings to JSON double quotes | {'name': 'Asha'} becomes {"name":"Asha"} |
| Unquoted object keys | Adds quotes around recognizable bare keys followed by a colon | {name: "Asha"} becomes {"name":"Asha"} |
| Trailing commas | Removes a comma immediately before a closing brace or bracket | [1, 2,] becomes [1, 2] |
| Unmatched opening delimiters at the end | Adds closing braces or brackets when their order is consistent | {"items": [1, 2 can be closed as {"items": [1, 2]} |
| Leading byte-order mark | Removes a leading BOM before parsing | Useful when a text file begins with a byte-order mark |
Example: Repair a Truncated JSON-Like Snippet
Suppose a response ends before its brackets are closed and uses JavaScript-style comments, an unquoted key, and single quotes:
{
// display preference
theme: 'dark',
tabs: ['home', 'profile',
The tool removes the comment, quotes the key and strings, closes the unmatched array and object, then checks whether the result parses. The repair details list the corrections; the formatted output shows the repaired text. The tool does not invent missing fields or decide whether "dark" is the right value for your application.
How to Repair Invalid JSON
- Paste JSON-like text into Input JSON, select Open JSON to choose a file, or load the sample.
- Select Repair JSON.
- Review Repair details to see which correction types were applied.
- Check the formatted result against the original data and your application’s expectations.
- Copy or download the repaired JSON only after confirming that it says what you intend.
The output is formatted with indentation after it passes JSON parsing. Formatting makes the result easier to read, but it does not validate required fields, data types, or business rules.
What It Cannot Safely Guess
This is a syntax repair tool, not a general-purpose recovery system. It does not add missing commas or values, finish an unterminated string, reorder mismatched braces, extract JSON from surrounding prose or Markdown fences, or convert Python values such as True, False, and None. Those cases can be ambiguous: a missing comma may leave several possible interpretations, and an incomplete string may have lost meaningful data.
If the tool cannot produce text accepted by the JSON parser, check the reported error and correct the remaining issue manually. After repair, compare important output with the source; changing quote styles or removing comments can affect how JSON-like text is interpreted.
JSON Repair vs. JSON Validation
A JSON Validator checks whether text is already valid JSON and helps identify syntax errors. A repair tool attempts a defined set of corrections and shows the resulting changes. Use repair when the input contains supported JSON-like syntax; use validation when you want to check a document without changing it. A valid JSON document can still have the wrong structure for your application, which requires a schema or application-specific checks.
Privacy and Input Limit
Input can be up to 10 MiB. The repair logic runs in your browser without a third-party repair library, and the page does not upload the input to RomitJSON. Avoid entering passwords, access tokens, private keys, or confidential records into online tools unless their handling fits your requirements.
Frequently Asked Questions
Will this tool repair every invalid JSON file?
No. It handles a specific set of syntax issues: comments, single-quoted strings, recognizable unquoted keys, trailing commas, a leading BOM, and unmatched opening braces or brackets at the end. Other errors may need manual correction.
Can it add missing commas or values?
No. The tool does not guess where a missing comma belongs or what a missing value should be. Review the error and edit the input when a repair would require guessing.
Does JSON Repair change my data?
It can change how JSON-like text is interpreted when it converts quotes or removes comments. Review the listed corrections and compare the output with your intended data before using it.
What happens if my JSON is already valid?
The tool reports that no repair was needed and returns a formatted version of the parsed JSON.
Does repair confirm that the data is correct for my app?
No. It confirms only that the repaired output parses as JSON. Use a schema or application checks to validate required fields and values.
Related JSON Tools
Use the JSON Validator to check syntax without editing the input, the JSON Formatter to make valid JSON easier to read, or the JSON Schema Validator to check data against a schema.