Quick answer
JSON null vs Empty – causes and fixes.
JSON null vs Empty
JSON null vs Empty – causes and fixes. Use a JSON validator to locate the error.
Common causes
- Treating null and "" the same.
- Schema expects null.
How to fix
- Use null for missing; "" for empty string.
Use our JSON Validator to paste your input and see the exact error location. Validatethis.org offers free validators for JSON, XML, CSV, HTML, and more. Check /tools for the full list. For API access and integration, see /developers.
FAQ
- When use null?
- For absent values.
- Empty array valid?
- Yes, [].
Fix it now
Try in validator (prefill this example)