← All Tools

JSON Cleaner

Recursively strip null, empty strings, empty arrays, empty objects, false, zero, and NaN values from JSON. Useful when normalising API responses for diffing, shrinking config files, or producing minimal seed data — toggle each rule independently and preserve key order.

Indent
input 0 chars output 0 chars saved 0 removed 0 values

How "empty" Is Decided

Each rule is checked after children are already cleaned, so a property like {"a": {"b": null}} with both "remove null" and "remove empty objects" enabled collapses all the way to {} — or, if recurse until stable is on, gets removed by the next pass too. Strings are matched literally; flip "trim before checking" to also drop whitespace-only strings like " ". The cleaner never reorders keys unless you ask it to. NaN, Infinity, and -Infinity aren't valid JSON in the first place — the input parser will reject them with a syntax error, but the output guarantees nothing leaks through.