SmartJson.io

JSON Repair

Paste broken JSON in the editor above and press Repair. You get valid JSON back and a list of every change, so you can check that nothing was lost. It runs in your browser; nothing is uploaded.

What it fixes

InputWhat it does
A ```json code block with text around itTakes the JSON out and says what text it ignored.
Trailing commas and commentsRemoves them and counts how many.
Python dicts: 'quotes', True, NoneRewrites them as JSON.
JavaScript objects: {name: 'Ada'}Quotes the keys and changes the quotes.
Windows paths like C:\UsersDoubles the backslashes so the text stays exactly the same.
A raw line break inside a stringWrites it as \n.
A missing comma between two valuesAdds it.
An invisible byte order mark (BOM)Removes it.

What it fixes with a warning

These change the meaning a little, so the result is marked with a ! and a note.

InputWhat it does
Cut-off JSONCloses the open strings and brackets. The last value may be incomplete.
JSON Lines (one document per line)Wraps the documents in one array.
NaN and InfinityJSON has no way to write them, so they become strings.
undefinedBecomes null.

What it refuses to repair

Some inputs have no JSON in them. A repair library will still turn them into something that parses, which hides the real bug. This tool stops and tells you what the input is instead.

InputWhat it tells you
An HTML pageShows the page title. The request that returned it needs fixing.
[object Object]The data was lost when the object became a string.
An empty inputUsually an empty response body.

How it works

The repair itself is done by jsonrepair, an open-source library. Before it runs, this page checks for the inputs above that it should refuse, takes JSON out of code blocks, and keeps Windows paths intact (jsonrepair would otherwise drop the backslashes). After it runs, the result is parsed again with JSON.parse to make sure it is valid, and the Changes section under the editor compares it with your input token by token.

Got an error message?

JSON Error Messages, Decoded explains what each parser's message means, with the exact text from Chrome, Firefox, Safari, Node and Python. To check JSON without changing it, use the JSON Validator.

All Tools & Converters

JSON Tools

  • JSON Hub
  • JSON Formatter
  • JSON Validator
  • JSON Repair
  • JSON Error Messages
  • JSON Viewer
  • JSON Minify
  • JSON Stringify
  • JSON Sorter
  • JSON Compare
  • JSON to CSV
  • JSON to XML
  • JSON to YAML

XML Tools

  • XML Hub
  • XML Formatter
  • XML Validator
  • XML Compare
  • SOAP Formatter
  • WSDL Formatter
  • XML to JSON
  • XML to CSV

CSV Tools

  • CSV Hub
  • CSV Formatter
  • CSV Validator
  • CSV to JSON
  • CSV to XML
  • Compare Tools

    • JSON Compare
    • XML Compare
    • YAML Compare
    • CSV Compare
    • Text Compare

YAML Tools

  • YAML Hub
  • YAML Formatter
  • YAML Validator
  • YAML to JSON
  • Other Tools

    • Converters Hub
SmartJson.io

JSON, XML, CSV and YAML tools that run in your browser. Nothing you paste is uploaded.

Sitemap

Company

  • About Us
  • Contact
  • How We Test
  • Changelog
  • Privacy Policy
  • Terms of Service
  • Cookie Policy
  • Disclaimer

© 2026 SmartJson.io. All rights reserved.

Report a problem with this page
Made withfor developers
1
0 chars | 1 lines

JSON Repair

Output

No output yet

Click a button in the control panel to process data

0 chars