JSON Wrench repairs broken JSON in one click and shows you exactly what it changed. The example above has six problems at once: a comment, a missing comma, a Python True, a single-quoted key, curly quotes and an array that was cut off. Press Fix and all of them are repaired.
Auto-fix never silently edits your input. The repaired version appears on the right with a list of every change, and you choose whether to use it.
Example
{
// config
"port": 8080
"debug": True,
'host': “localhost”,
"retries": [1, 2, 3{
"port": 8080,
"debug": true,
"host": "localhost",
"retries": [
1,
2,
3
]
}What auto-fix can repair
Auto-fix handles the mistakes that come from copying data out of code, logs, chat apps and config files:
- Missing commas, trailing commas and doubled commas.
- Single-quoted strings and keys, unquoted keys.
- Python values
True,FalseandNone. //,/* */and#comments.- Curly "smart" quotes and invisible characters such as non-breaking spaces.
- Unclosed brackets and strings from data that was cut off.
NaNandInfinity(replaced withnull, since JSON has no equivalent), hex numbers, leading+and.5-style numbers.- Text before the JSON, such as a log line prefix like
[INFO] payload=, and text after it. - Several JSON values in a row, such as NDJSON log lines.
- Escaped JSON strings, which are unescaped and formatted.
Every change is shown
After a fix you get a list of changes, each with its line and column in your input and the text before and after. Notes explain anything that is not obvious, for example when NaN was replaced with null or when backslashes in a Windows path were kept as literal characters.
Numbers are copied exactly as written. Many tools run JSON through JSON.parse and back, which silently turns 12345678901234567890 into 12345678901234567000. JSON Wrench only moves whitespace when it formats, so your data stays exact.
When auto-fix refuses
Some input cannot be repaired without guessing, for example HTML error pages, plain sentences or Python tuples. In those cases JSON Wrench explains the problem and leaves your input unchanged instead of producing JSON that does not mean what you intended.
Frequently asked questions
Will auto-fix change my data?
It only changes syntax: quotes, commas, brackets, comments and literals JSON does not allow. Every change is listed so you can review it before using the result.
Can it fix JSON copied from a log file?
Yes. Text before the first { or [ (timestamps, log levels, labels) is removed, and several JSON objects in a row are handled as separate values.
Is it safe for sensitive data?
Repair runs entirely in your browser. Your JSON is not uploaded or stored on any server.