Recursively remove all null values from JSON objects and arrays in one click. Free online JSON null remover — runs in your browser, nothing uploaded. Handles deeply nested JSON.
The JSON Null Remover recursively traverses your entire JSON tree and strips every key whose value is null from objects, and filters out null elements from arrays. The result is clean JSON ready for databases, APIs, or config files that don't accept null values. All processing happens locally in your browser — your JSON is never uploaded to any server.
The tool uses a depth-first traversal of the JSON tree:
Important: empty objects {} and empty arrays [] that result from null removal are retained in the output. Only null itself is removed — not falsy values.
JavaScript (recursive):
function removeNulls(obj) {
if (Array.isArray(obj)) return obj.filter(v => v !== null).map(removeNulls);
if (typeof obj === 'object' && obj !== null) {
return Object.fromEntries(
Object.entries(obj).filter(([,v]) => v !== null).map(([k,v]) => [k, removeNulls(v)])
);
}
return obj;
}
Python:
def remove_nulls(obj):
if isinstance(obj, list):
return [remove_nulls(v) for v in obj if v is not None]
if isinstance(obj, dict):
return {k: remove_nulls(v) for k, v in obj.items() if v is not None}
return obj
Paste your JSON into the input editor and click Process. The tool recursively removes all null keys from objects and null elements from arrays. Copy or download the cleaned JSON from the output panel. No account required, nothing uploaded.
No. This tool strictly removes exact JSON null — not empty strings "", 0, false, [], or {}. Only explicit null values are stripped.
Use: function removeNulls(obj) { if (Array.isArray(obj)) return obj.filter(v => v !== null).map(removeNulls); if (typeof obj === 'object' && obj !== null) return Object.fromEntries(Object.entries(obj).filter(([,v]) => v !== null).map(([k,v]) => [k, removeNulls(v)])); return obj; }
No. Empty {} and [] containers that result from null removal are preserved in the output. To also remove empty containers, run a second pass that filters them out after null removal.
No. All processing runs locally in your browser using JavaScript. Your JSON is never transmitted to any server — safe for sensitive API responses, credentials, or configuration files.