JSON empty value remover
Processed in your browser · nothing is uploaded
Strips null, empty strings, empty arrays and empty objects recursively — so a branch left empty because its contents were removed is removed too.
How to use the json empty value remover
Recursion is the part naive implementations skip: removing a null inside an object can leave that object empty, and leaving the husk behind defeats the purpose. Working bottom-up handles it, and if the whole document empties out you get {} rather than nothing, so the result is still valid JSON.
What counts as empty is a judgement, and this one is drawn deliberately narrowly. Null and the empty string go. false, 0 and a string of spaces all stay: the first two because dropping a meaningful value is a real bug, the third because trimming is a different operation with different consequences and should be a decision you make on purpose.
The sharp edge is arrays. Removing a null from the middle of one closes the gap, so [1, null, 3] becomes [1, 3] and everything after the removal shifts down an index. If positions carry meaning. A fixed-width row, two arrays read in parallel, an index stored somewhere else. This rewrites your data rather than tidying it, silently and everywhere at once.
The same caution applies to null itself. Plenty of APIs distinguish "field absent" from "field explicitly null", the second meaning clear this value. Running a PATCH body through here turns every deliberate null into an omission, which is the opposite instruction.
Questions
No. Those are meaningful values. Only null, empty strings and empty containers go.
Yes. An object left empty because its contents were removed is removed as well.
The gap closes. [1, null, 3] becomes [1, 3], so everything after it shifts down one index.
Not here. Only the empty string counts. Trimming values is a separate decision.
It can. If your API treats an explicit null as "clear this field", stripping it says nothing at all instead.
Yes, along with empty objects. If everything goes, you are left with {}.
No. Parsing and formatting happen in your browser, which matters when the JSON is an API response with real data in it.