jsontoolskit.org
JSON and JSON Schema utilities, in the browser
Say hi →

Remove Nulls from JSON

strip nulls and empty values · recursive, with pruning · updated 28 July 2026

Strip null values out of a JSON document, and optionally empty strings, empty arrays and empty objects too. Cleaning runs bottom-up, so a container left empty by its children being removed is pruned as well. The status bar shows how many bytes you saved.

Paste input to start.

How to remove nulls from JSON

  1. Paste your JSON, or drop a file onto the input pane.
  2. Nulls are removed by default. Tick the additional boxes for empty strings, arrays and objects if those are noise in your data too.
  3. Leave pruning on so an object whose only key held a null disappears rather than becoming {}.
  4. Watch the byte counter — sparse API payloads and event logs often shrink 30–60%.
  5. Copy or download the cleaned JSON.

null is not always noise

Before stripping, be sure your consumer treats a missing key and a null key the same way. Three places where they differ:

Removing false and 0 is riskier still — both are real values, not absence. Those options exist for the specific case of a payload padded with defaults, and are off by default.

Privacy

Nothing is uploaded. The conversion runs in this tab using your own browser's JavaScript engine — no server sees your data, and the page keeps working with the network disconnected.

FAQ

Does it remove array elements too?

Yes — a null inside an array is removed and the array closes up, so indexes shift. If positions are meaningful, keep nulls in arrays and only clean objects.

What does pruning actually do?

It handles the second-order case. If {"meta": {"debug": null}} loses debug, meta becomes {}. With pruning on and Remove empty objects ticked, meta goes too. Turn pruning off to keep the empty shell.

Will this reduce my response size much?

It depends on how sparse the data is. Wide event records with many optional fields shrink dramatically; dense records barely change. For a full byte-level breakdown try Size analyzer.