Remove nulls from JSON
Paste or drop your data here, or open a file.
New to Bracely?
Everything stays in your browser.
Output appears here
Paste or open your data in the input box. It never leaves your browser.
Remove Null and Empty Values
Clean up JSON by stripping null values, empty strings, empty arrays and empty objects at every level. Zero and false are kept.
Example: cleaning up a user record
A record with null, empty strings, an empty list and an empty object, at different depths. With Remove set to everything empty, they all go, and so does address.geo once it's empty; the 0 and false stay:
Input
{
"id": 7,
"name": "Ananya",
"nickname": null,
"phone": "",
"tags": [],
"address": {
"line2": null,
"city": "Pune",
"geo": {}
},
"orders": [
{
"id": "ORD-1",
"coupon": null,
"qty": 0,
"gift": false
}
]
}Output
{
"id": 7,
"name": "Ananya",
"address": {
"city": "Pune"
},
"orders": [
{
"id": "ORD-1",
"qty": 0,
"gift": false
}
]
}
How do I use the Remove nulls from JSON?
- Paste JSON.
- Choose what to remove: nulls, empties, or both.
- Copy the cleaned JSON.
What does the Remove nulls from JSON do?
- Works at every level
- Zero and false are kept
- Nulls only, empties only, or both
When to use the Remove nulls from JSON
APIs and exports often fill records with null, empty strings and empty lists for fields that have no value. Stripping them makes a payload shorter and easier to read, keeps test fixtures and documentation examples to the point, and avoids sending empty fields an API would reject.
Remove has three settings: nulls and empty values (all of them), nulls only, or empty strings, arrays and objects only. It works at every depth, inside arrays too, and an object or array that becomes empty once its contents are removed goes as well. 0 and false are real values, so they're always kept.
Frequently asked questions
- What's the difference between null and missing?
- A key with null says the value is unknown or cleared; a missing key says nothing. Many APIs treat them differently, for example when updating a record, so remove nulls only when the receiver doesn't care.
- Will it remove whitespace-only strings like " "?
- No. Only strings that are completely empty are removed; a space is a value. Trim them first if you need to (Find & replace with ^\s+$ works).
- Will it remove 0 or false?
- No. Only null, empty strings, empty arrays and empty objects are removed.
- Is my data uploaded?
- No. Bracely runs entirely in your browser, so nothing you paste or open leaves your device.
More JSON tools
Bracely has 108 JSON tools in one page. Related ones:
- List tools
- Remove duplicates
- Unix timestamp converter
- Filter JSON fields
- JSON pipeline
- JS macro
- Unflatten JSON
- Merge JSON
- Flatten JSON
- Convert JSON key case
- Compare JSON arrays
- API breaking change checker
- Ask AI
- Regex tester
- JSON Formatter
- JSON Validator
- JSON Viewer
- JSON Repair
- JSON Diff
- JSON to YAML
- JSON to CSV
- jq Playground
Runs entirely in your browser. Nothing you paste is uploaded. Made by Saurabh Pagrut · About · Privacy policy
Last updated · Version 6.7 · Changelog
Saurabh Pagrut on GitHub · LinkedIn · X · YouTube · Instagram