JSON formatter and validator that also explains and fixes errors
An API returns one long line, or a config file fails with "Unexpected token at position 4187". Paste or attach the JSON and your todo.is agent formats it, validates it with a real parser, points to each error by line and column, fixes what can be fixed safely and, if you give it a schema, checks every field against it.
The prompt
- Format and validate this JSON: [JSON TEXT OR ATTACHED FILE]. Pretty-print it with [INDENTATION]. Run it through a strict JSON parser and list every error with line and column, what's wrong and the fix. Fix only syntax problems (trailing commas, single quotes, missing brackets, comments) and don't change any values. Then [EXTRA CHECK]. Send back the fixed file as .json plus a short report of what changed.
What to change
- [JSON TEXT OR ATTACHED FILE]: Paste the JSON or attach a .json, .txt or log file (up to 50 MB).
- [INDENTATION]: E.g. "2 spaces", "4 spaces", "tabs", or "minified, one line".
- [EXTRA CHECK]: E.g. "check it against the attached JSON Schema", "convert it to CSV", "sort keys alphabetically", or "nothing else".
Example result
- Validation report for products.json
- Errors found (strict JSON parser)
- • Line 14, column 5: trailing comma after the last item in "tags". Removed
- • Line 27, column 13: single quotes around 'in_stock'. JSON keys and strings need double quotes. Changed to "in_stock"
- • Line 41, column 1: a // comment. JSON has no comments. Removed (the text was "// TODO check price")
- • Line 88, column 2: missing closing ] for "variants". Added after the last variant
- After these fixes the file parses cleanly: 1 object, 3 products, 9 variants.
- Formatted result (excerpt)
- {
- "products": [
- {
- "id": "sku-1042",
- "name": "Linen Tote Bag",
- "price": 24.5,
- "in_stock": true,
- "tags": ["linen", "bags"],
- "variants": [
- { "color": "natural", "qty": 12 },
- { "color": "olive", "qty": 0 }
- ]
- }
- ]
- }
- Schema check (product.schema.json)
- • products[2].price is the string "19.90", but the schema expects a number. Not changed, because it's a value; decide if the source should send a number
- • All required fields (id, name, price, in_stock) are present in every product
- Nothing else changed
- • Values, key order and Unicode text (é, ü, emoji in descriptions) are exactly as in the original
- • Duplicate key check: none found
- Files
- • products_fixed.json: valid, 2-space indentation
- • The original is untouched in your workspace if you need to compare
How to do it with todo.is
- Copy the prompt and paste the JSON or say "attached".
- Attach the file on the Today screen in todo.is, or send it to your agent on Telegram or WhatsApp.
- Your agent parses it, fixes the syntax, formats it and reports every change.
- Download the fixed .json, or ask for it minified, sorted or converted to CSV or Excel.
Tips for a better result
- "Unexpected token" errors usually point just after the real problem. Look at the line above too.
- JSON doesn't allow comments, trailing commas or single quotes. If you need those, the file is JSON5 or JSONC; say so.
- Big numbers like IDs over 2^53 lose precision in JavaScript. Ask your agent to check for long IDs that should be strings.
- Give a JSON Schema if you have one; syntax-valid JSON can still have wrong types or missing fields.
- Remove tokens and personal data from API responses before sharing them.
JSON formatter and validator: FAQ
- What is the difference between formatting and validating JSON? Formatting changes only spacing and line breaks to make it readable. Validating checks that it's correct JSON syntax and, with a schema, that fields have the right names and types.
- Why is my JSON invalid? The most common causes are trailing commas, single quotes, unquoted keys, comments, missing brackets and unescaped quotes or line breaks inside strings.
- Can it convert JSON to Excel or CSV? Yes. Nested objects are flattened into columns like variants.color, and arrays can become one row per item. Say which layout you want.
- Is there a size limit? You can attach files up to 50 MB. Very large files are processed with a streaming parser, and the report lists errors rather than printing the whole file.
JavaScript is required to use the todo.is app.