0 chars · 1 line
Two-way sync · Edit either side and the other updates automatically.
0 chars · 1 line
Two-way sync · Edit either side and the other updates automatically.
JSON runtime troubleshooting
JSON.parse expects a complete JSON value. An empty string has no value at all, so browser and runtime parsers fail before they can build an object, array, string, number, boolean, or null. This tool is free to use. No account or payment is required.
Last updated
The four characters null form a valid JSON value. A zero-length string does not. Treating the two as interchangeable can hide a missing response or storage bug.
If an API promised JSON, an empty body may be the real defect. Check the HTTP status and response body before changing the client to silently accept missing data.
There is no JSON token to parse. The corrected example uses explicit null only when missing data is an allowed state.
nullCommon questions
No. A JSON document must contain a value; an empty string contains none.
Only if an empty object is the documented meaning of that response. Otherwise investigate why the body is missing.
No. Application coercion can differ by runtime and API usage. Prefer parsing known JSON text and handling non-string state explicitly.
Debugging a specific JSON issue? Browse JSON troubleshooting.