JSON Fixer

What is JSON Fixer

JSON Fixer is a tool to fix broken JSONs. I dealt with a lot of broken JSONs at times and wished a tool like this existed, so I created one for myself.

A lot of people use Large Language Models (LLMs) like ChatGPT, Claude, etc. to get JSON responses. These responses are at times broken. Each response has a chance of being broken in a different way, so a generic fixer might help.

Also when printing Python dicts, Python JSONs, Java stringifys, etc., they inadvertently add a lot of extra information to the JSON. This tool fixes the JSON created by them too.

How does it work?

Logic Based Engine

I started with a few examples of broken JSON and wrote regex to fix them. This approach was quickly hacked by internet people.

So, I wrote a huge state machine like architecture for each state and how to handle it. Then wrote a custom engine based upon it.

AI Engine

The logic engine still fails for 20% of the queries. So, I also added LLMs to the mix for even better results.

Frequently Asked Questions (FAQ)

Is my JSON broken? How can I tell?

There are a few ways to identify if your JSON is broken. It might not display correctly in a JSON viewer, or you might encounter errors when trying to parse it in your code. Online JSON validators can also help diagnose issues.

What types of JSON data can JSON Fixer handle?

JSON Fixer can handle most commonly formatted JSON data, including objects, arrays, strings, numbers, booleans, and null values.

What if JSON Fixer can't fix my JSON?

If JSON Fixer encounters an issue it can't handle, it will display an error message indicating the problem's location in the JSON data. You can then manually address the error or use a different JSON fixing tool.

Are there any limitations to using JSON Fixer?

While JSON Fixer can address many common JSON issues, it's important to note it might not be able to fix severely corrupted data. Additionally, complex formatting issues might require manual intervention.