Fix Invalid JSON Online - Find Syntax Errors Fast
Paste invalid JSON to find the parse error, fix the broken character, and rerun the same validator before formatting, diffing, or schema checks.
Paste your JSON → Get results instantly (no signup)
→ Validate this order payload against a small schema config.
1{2 "valid": false,3 "errors": [4 {5 "field": "customer_email",6 "message": "Expected string, received null"7 },8 {9 "field": "total_amount",10 "message": "Expected number, received string"11 },12 {13 "field": "items",14 "message": "Expected array, received number"15 }16 ]17}Love the result?
Use this exact pipeline in your app, backend, or LLM workflow.
No setup needed. Works with curl, Node, Python.
Uses example data. For edited input, copy from the playground.
Works with:
- Parser error debugging
- Broken config files
- LLM-generated JSON
- API payload repair
Example: input → output
Fix invalid JSON
Invalid JSON usually fails for a small reason: a trailing comma, a comment, a missing quote, a bad number, or a bracket that disappeared during copy-paste. This page helps you find the syntax error quickly so the document can parse again.
Paste the broken JSON into the tool and run the validator. The result points to the first parse failure. Fix that character, rerun the check, and repeat until the payload is valid. Once the JSON parses, you can format it, compare it, convert it, or validate it against a schema.
How to fix invalid JSON online
- Paste the invalid JSON into the input panel.
- Run the validator and read the error location.
- Fix the first syntax problem the parser reports.
- Run the check again because one invalid character can hide later errors.
- When the JSON is valid, continue with formatting, cleanup, conversion, or schema validation.
This page uses the same engine as the JSON Schema Validator, but it is framed around parser-error repair rather than structural validation.
Common causes of invalid JSON
- Trailing commas in arrays or objects.
- Single-quoted strings copied from JavaScript.
- Unquoted object keys such as
{name: "Ada"}. - Comments from JSONC, TypeScript config files, or copied examples.
- Invalid numbers such as
NaN,Infinity,5., or007. - Missing closing braces after trimming a snippet.
If you are not sure whether the document is broken or just ugly, start with Check JSON Format. If you simply need a syntax pass/fail result, use Validate JSON Online.
What to do after fixing JSON
After the syntax passes, use the JSON Formatter to format JSON and remove cleanup noise. Use the JSON Diff Tool to compare the fixed payload with a previous version. Use the JSON to CSV Converter when the valid data needs to move into a spreadsheet.
If the payload must satisfy an API contract, required fields, or specific types, run the JSON Schema Validator after the JSON is valid.
Related JSON Tools
- JSON Schema Validator - validate structure, required fields, and expected types.
- JSON Formatter - format JSON, trim strings, sort keys, and clean noisy values.
- JSON to CSV Converter - turn valid JSON arrays into spreadsheet-ready CSV.
- JSON Diff Tool - compare two valid JSON documents path by path.
- JSON Lint - lint JSON online after repair and before handoff.
Frequently asked questions
How do I fix invalid JSON?+−
Run the validator, fix the first parser error it reports, and rerun the check. Repeat until the document parses cleanly.
What is the most common invalid JSON error?+−
Trailing commas, single quotes, unquoted keys, comments, invalid numbers, and missing closing brackets are the most common syntax failures.
Can this repair JSON automatically?+−
The page focuses on locating syntax errors clearly. Some cleanup steps can be handled after parsing, but invalid syntax should be fixed deliberately so data is not changed unexpectedly.
Why does the parser only show one error?+−
JSON parsers stop at the first syntax failure because later characters may be interpreted incorrectly after the first broken token.
What comes after fixing invalid JSON?+−
Once syntax is valid, format or clean the JSON, compare it with another version, convert it to CSV, or validate the structure with JSON Schema.
Related tools
Read more on the blog
Advanced usage (optional)
Schema Validation
v1.0.0Description
Schema Validation
Validate JSON against a JSON Schema-style subset and return a field-level report.
This utility is a report-producing transformer. It does not block, skip, warn, or otherwise control pipeline execution. Use validation.contract when a pipeline needs guardrail behavior.
Supported V1 Schema Fields
type:object,array,string,number,boolean, ornullrequired: array of required object keysproperties: object field rulesitems: array item ruleenum: primitive values only, using strings, numbers, booleans, or null
Unknown fields are ignored in V1.
Invalid schema config returns:
{
"valid": false,
"errors": [
{ "field": "$schema", "message": "Missing or invalid schema config" }
]
}Configuration
| Name | Type | Default | Description |
|---|---|---|---|
| Schema Config | json | {"type":"object","required":[],"properties":{}} | JSON Schema-style subset. Supports type, required, properties, items, and primitive enum values. Unknown fields are ignored in V1. |
Examples
Validate this order payload against a small schema config.1{2 "valid": false,3 "errors": [4 {5 "field": "customer_email",6 "message": "Expected string, received null"7 },8 {9 "field": "total_amount",10 "message": "Expected number, received string"11 },12 {13 "field": "items",14 "message": "Expected array, received number"15 }16 ]17}1{2 "type": "object",3 "required": [4 "order_id",5 "customer_email",6 "total_amount",7 "currency",8 "items"9 ],10 "properties": {11 "order_id": {12 "type": "string"13 },14 "customer_email": {15 "type": "string"16 },17 "total_amount": {18 "type": "number"19 },20 "currency": {21 "type": "string",22 "enum": [23 "USD",24 "EUR",25 "GBP"26 ]27 },28 "items": {29 "type": "array",30 "items": {31 "type": "object",32 "required": [33 "sku",34 "qty"35 ],36 "properties": {37 "sku": {38 "type": "string"39 },40 "qty": {41 "type": "number"42 }43 }44 }45 }46 }47}API Usage
curl -X POST https://your-domain.com/api/v1/utilities/validation.schema \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"inputs":{"primary":{"order_id":"ORD_1001","customer_email":null,"total_amount":"42.50","currency":"USD","items":2}},"config":{"schema":{"type":"object","required":["order_id","customer_email","total_amount","currency","items"],"properties":{"order_id":{"type":"string"},"customer_email":{"type":"string"},"total_amount":{"type":"number"},"currency":{"type":"string","enum":["USD","EUR","GBP"]},"items":{"type":"array","items":{"type":"object","required":["sku","qty"],"properties":{"sku":{"type":"string"},"qty":{"type":"number"}}}}}}}}'1{2 "valid": false,3 "errors": [4 {5 "field": "customer_email",6 "message": "Expected string, received null"7 },8 {9 "field": "total_amount",10 "message": "Expected number, received string"11 },12 {13 "field": "items",14 "message": "Expected array, received number"15 }16 ]17}