{ } JSON Workpad

JSON TROUBLESHOOTING

Fix invalid JSON.
Understand the error.

Six common problems, corrected examples, and a clear way to check your next change.

Open the free JSON validator →

Paste your document into JSON Workpad and select Validate. An error includes its line and column, a highlighted excerpt and a suggested correction. Use Jump to error to select the location. Fix the first issue and validate again: a later error may only become visible after the first one is resolved.

Remove trailing commas

A comma separates two properties or array items. It cannot appear immediately before the closing brace or bracket. Remove only the final comma; keep the commas between earlier items.

Problem input

{"name":"Ada","active":true,}

Corrected example

{"name":"Ada","active":true}

Try problem input in validator → · Validate corrected example →

Use double quotes for keys and strings

JavaScript object literals can use single quotes or unquoted keys, but JSON cannot. Quote each key and string with double quotes. Do not blindly replace every apostrophe: an apostrophe inside a name such as O’Neil is part of the value.

Problem input

{'name': 'Ada'}

Corrected example

{"name":"Ada"}

Try problem input in validator → · Validate corrected example →

Separate properties with a comma

The parser may point to the second key because that is where it discovers the missing separator. Inspect the text immediately before the reported location as well as the highlighted character.

Problem input

{"name":"Ada" "active":true}

Corrected example

{"name":"Ada","active":true}

Try problem input in validator → · Validate corrected example →

Escape backslashes in Windows paths

A backslash starts an escape sequence in JSON. Write two backslashes to represent one literal backslash. For a line break inside a string, use the escape sequence \n instead of placing a raw line break between the quotes.

Problem input

{"path":"C:\Users\Ada"}

Corrected example

{"path":"C:\\Users\\Ada"}

Try problem input in validator → · Validate corrected example →

Use JSON values instead of JavaScript values

Boolean literals are lowercase true and false. JSON has no undefined, NaN or Infinity values. Use null only when it correctly represents your data, or remove the property if your application expects it to be absent. Null and a missing property are different.

Problem input

{"active":True,"result":undefined}

Corrected example

{"active":true,"result":null}

Try problem input in validator → · Validate corrected example →

Resolve duplicate keys deliberately

Repeated names can produce different behavior across parsers. JSON Workpad rejects them during validation to avoid silently losing a value. In this example, keeping 4 is a deliberate choice, not an automatic repair. Its comparison tool instead uses the last occurrence and displays a warning.

Problem input

{"expiry_buffer":3,"expiry_buffer":4}

Corrected example

{"expiry_buffer":4}

Try problem input in validator → · Validate corrected example →

When valid JSON still fails in your application

Valid syntax does not guarantee that an API accepts the document. An API might require an integer instead of a string, a particular date format or a mandatory field. Check its schema and error response after syntax validation succeeds.

Keep identifiers precise. JSON Workpad preserves numeric text such as 9007199254740993 during formatting. Other software may round long numbers when it parses them; follow your API contract when choosing between a number and a string.

Compare the result before sending it

Use JSON comparison to inspect property and value changes. Object key order is ignored, while array order matters. To review punctuation, spacing or the original text exactly as entered, use text comparison.

For data imports, convert CSV to JSON while keeping cell values as strings. For spreadsheet exports, convert flat JSON records to CSV.

Privacy and limits

Validation runs in your browser without sending your JSON to a server. The input limit is 1 MB and the nesting limit is 120 levels. The validator checks syntax and duplicate keys; it does not automatically repair or rewrite your input.

Validate your JSON → · Read the JSON format specification (RFC 8259)