Strip null values, empty strings, empty objects and empty arrays from JSON — you choose which. Parents that become empty can be removed too. 0 and false are always kept.
Show calculation steps
Processed privately in your browser — nothing you paste is uploaded, logged or stored.
What gets removed — and what never does
APIs and exports love padding data with null, empty strings and hollow containers. This tool strips them recursively, but only the kinds you tick: null values, "", {} and [] each have their own checkbox. Two things are never touched: 0 and false. They look falsy to a careless filter, but they are real data — a price of zero and a disabled flag mean something.
Worked example
Input:
{
"name": "Report",
"owner": null,
"summary": "",
"meta": { "tags": [], "notes": null },
"rows": [ { "id": 1, "comment": "" }, { "id": 2, "comment": "ok" } ]
}With every option on (including cascade), 6 empty values disappear and meta itself — emptied by the cleanup — goes with them:
{
"name": "Report",
"rows": [ { "id": 1 }, { "id": 2, "comment": "ok" } ]
}When to use it
- Shrinking request payloads before sending them over the wire.
- Cleaning database or CMS exports where unused fields arrive as null padding.
- Preparing JSON for a diff, so meaningless empties do not show up as changes.
- Tidying config files where empty placeholder sections accumulated over time.
Limitations to know
- In PATCH-style APIs,
"field": nulloften means “clear this field” — removing it changes the request’s meaning. Strip nulls only when the receiver treats null and absent identically. - Removing items from arrays shifts the indexes of everything after them.
- Cascade re-checks until stable, so deeply nested shells vanish completely — if you want one level only, untick cascade.
Common errors and fixes
- “Nothing to remove — the input is a single scalar value” — a bare number or string has no members to clean; this is informational, not a failure.
- A field I expected to vanish survived — check its actual value:
0,falseand strings of whitespace are not empty. Whitespace-only strings are kept deliberately, since trimming is a content change. - Too much vanished — cascade removed containers that only held empties; untick cascade or fewer empty-kinds and re-run. Your input stays in the panel, so re-running with different options is instant.
How to use the JSON Empty Value Remover
- Paste your JSON into the input panel.
- Tick what counts as empty for your case — null values, empty strings, empty objects, empty arrays.
- Keep "remove parents that become empty" on if you also want emptied-out containers cleaned up.
- Click "Remove empty values" and copy the cleaned JSON.
Frequently asked questions
What counts as an empty value?
Only what you tick: null, "" (empty string), {} (object with no keys) and [] (array with no items). The values 0 and false are never removed — they are real data, not emptiness.
What does the cascade option do?
Removing inner values can leave hollow shells behind — an object whose every key was null becomes {}. With cascade on, the tool re-checks the result repeatedly until stable, so those newly-emptied containers are removed too.
Is removing nulls from an API payload always safe?
Not always. In PATCH-style APIs, "field": null often means "clear this field", which is different from omitting the field entirely. Strip nulls for compactness only when the receiving API treats null and absent the same way.
What happens to arrays when items are removed?
The remaining items close ranks — indexes shift down. If code elsewhere relies on fixed array positions, account for that before cleaning.