How to clean json data by removing null and empty values
- Step 1Export the dataset to a JSON file — Save the records as a single
.jsondocument — for example a JSON array of row objects. The tool parses the whole file withJSON.parse, so it must be one valid document, not line-delimited NDJSON. - Step 2Drop the file — Drag the file onto the dropzone or click to browse. The header shows the file name and size once it loads.
- Step 3Select cleaning aggressiveness — Start with
null values(default). For a thorough clean addempty strings,empty arrays, andempty objects. Be deliberate about empty arrays —[]can be a meaningful 'zero results' value in analytics. - Step 4Keep Deep on for nested rows — Leave Deep (strip at all nesting levels) checked so nested sub-objects and array elements are cleaned too. Uncheck it only when you want to clean top-level keys/items but leave nested structures intact.
- Step 5Run and review the count — Click Strip Values. The 'N values stripped' counter quantifies how sparse the dataset was; a surprisingly high count can flag an upstream extraction bug worth investigating.
- Step 6Load into your analysis tool — Download the cleaned file and load it:
pandas.read_json(), BigQuery JSON import, or DuckDBread_json_auto(). Fewer nulls means fewerNaNcells and less.dropna()/COALESCEscaffolding.
Cleaning targets and downstream effect
Each target removes one sparse-field artefact. Picked deliberately, they cut null-handling code in analytics tools.
| Target | Artefact removed | Downstream benefit | When to skip |
|---|---|---|---|
null values | null cells from unpopulated columns | Fewer NaN in Pandas; cleaner IS NULL filters | Skip if null is a deliberate sentinel |
empty strings | "" from blank text fields | String aggregations stop counting blanks | Skip if "" differs from missing in your model |
empty arrays | [] list fields with no items | No zero-width widgets; simpler nested explodes | Skip when [] means 'zero results' (it often does) |
empty objects | {} hollow wrappers | No empty struct columns to flatten | Rarely meaningful; usually safe to strip |
undefined values | n/a for files | No effect on a parsed file | Always — leave off for files |
Falsy values: preserved vs stripped
The engine matches exact values, not truthiness. Real zeros and booleans survive.
| Value | Stripped? | Reason |
|---|---|---|
null | Yes (if null ticked) | Explicit JSON null |
false | No | Valid boolean, never a target |
0 | No | Valid number, never a target |
"" | Only if empty strings ticked | Zero-length string |
" " | No | Whitespace is length>0, not empty |
"null" | No | It's a string, not the null literal |
[] | Only if empty arrays ticked | Zero-length array |
[null] | No (becomes [] then strips only if empty arrays ticked + Deep) | Length-1 array of a null element |
File and tier limits
Pro tool. From lib/tier-limits.ts and lib/csv-utils.ts.
| Limit | Free | Pro |
|---|---|---|
| Max file size | 2 MB | 100 MB |
| Files per run | 1 | Up to 10 |
| Accepted extensions | .json .ndjson .jsonl .txt | .json .ndjson .jsonl .txt |
| Runs in | Browser | Browser |
Cookbook
Real-shaped dataset fragments before and after cleaning. Values are illustrative.
Clean a record array for Pandas
ExampleNull cells across rows become NaN in a DataFrame. Stripping null (Deep on) removes the keys so absent columns simply don't appear for those rows.
Input (rows.json):
[
{ "id": 1, "score": 88, "note": null },
{ "id": 2, "score": null, "note": "flagged" }
]
Strip Values (targets: null · Deep on):
[
{ "id": 1, "score": 88 },
{ "id": 2, "note": "flagged" }
]Reindex arrays with null holes
ExampleAn array containing nulls is compacted and reindexed automatically, so iteration and length-based logic behave.
Input:
{ "readings": [12, null, 15, null, 9] }
Strip Values (targets: null · Deep on):
{ "readings": [12, 15, 9] }
length goes 5 -> 3, no gaps.Preserve real zeros
ExampleA metrics record with legitimate 0 values is cleaned of nulls but keeps every measured zero.
Input:
{ "clicks": 0, "impressions": 0, "ctr": null }
Strip Values (targets: null · Deep on):
{ "clicks": 0, "impressions": 0 }
The two zeros survive; only null ctr is removed.Thorough clean for a dashboard feed
ExampleStrip all four empties to remove every sparse artefact before the data hits a visualisation layer.
Input:
{
"name": "Widget",
"desc": "",
"tags": [],
"meta": {},
"price": 19
}
Strip Values (targets: null + empty strings + empty arrays + empty objects · Deep on):
{
"name": "Widget",
"price": 19
}Keep 'zero results' lists deliberately
ExampleWhen [] means the query ran and returned nothing, leave empty arrays unticked so that fact is not erased.
Input:
{ "customer": "C9", "orders": [], "refund": null }
Strip Values (targets: null only · empty arrays UNCHECKED):
{ "customer": "C9", "orders": [] }
The meaningful empty orders list is preserved.Errors and edge cases
Real errors and silent failures sourced from each platform's own documentation. Match the wording to the row, fix what the row says to fix.
Empty array carries meaning
CautionIn analytics, [] often means 'measured, none' — different from 'never measured'. Stripping empty arrays erases that. Leave it unticked unless an empty list is genuinely noise.
Real zero mistaken for missing
Preserved0 and false are never stripped, so a measured zero stays put. There is no truthiness-based mode — only exact null/empty matches are removed.
String 'null' from a CSV-derived export
PreservedIf a CSV-to-JSON step turned blanks into the text "null", those are strings and are not matched. Replace them before stripping, or they'll persist as noise.
Line-delimited NDJSON dataset
Parse errorA file with one record per line is not a single JSON document. Convert it to a JSON array first; otherwise JSON.parse throws and the run fails.
Invalid JSON in the export
Parse errorTrailing commas, NaN/Infinity literals, or a BOM cause a parse failure. Run the file through json-format-fixer first.
Whitespace-only string survives
Preserved" " is not an empty string to the engine (length is 1). If those should be cleaned, trim them upstream before stripping.
Deep off leaves nested nulls
ExpectedWith Deep unchecked only top-level keys/items are cleaned; nulls inside nested rows remain. Keep Deep on for record arrays.
Dataset over the size limit
BlockedFree caps at 2 MB; Pro at 100 MB. A larger dataset is blocked before processing — split it or upgrade.
Need a flat table, not nested JSON
Wrong toolStripping cleans the shape but doesn't flatten. To turn cleaned records into columns, follow with json-flattener or json-to-csv.
Output indentation is fixed
ExpectedCleaned output is 2-space pretty JSON. There's no indent option; minify with json-minifier if you need compact storage.
Frequently asked questions
Will cleaning remove my real zero and false values?
No. 0 and false are valid data and are never stripped. Only null, and whichever of empty-string/array/object you tick, are removed. There is no falsy mode that could catch zeros.
Does it reindex arrays after removing nulls?
Yes. Removing null elements compacts the array — [1, null, 2] becomes [1, 2] — so there are no holes for downstream iteration or length checks.
Should I strip empty arrays in an analytics dataset?
Often not. [] frequently means 'queried, zero results', which is a real fact. Leave empty arrays unticked unless an empty list is genuinely meaningless noise in your data.
How does this help with Pandas?
Loading JSON with many nulls produces NaN cells that break numeric ops and need .dropna(). Stripping nulls before read_json() removes those keys, so absent columns simply don't appear for those rows and you write less null-handling code.
Is my dataset uploaded anywhere?
No. The file is read and cleaned in your browser. Analytical data and any embedded customer fields never reach JAD Apps servers.
Can I clean a CSV with this tool?
No — it works on JSON files only. If your data is CSV, convert it first (or use a CSV cleaner), then strip the resulting JSON. To go the other way, json-to-csv turns cleaned JSON into a table.
What if the export is NDJSON?
Despite .ndjson/.jsonl being accepted extensions, the file must be a single JSON document. Line-delimited records won't parse — wrap them into a JSON array first.
Does it strip the string "null"?
No. Only the JSON null literal is matched, not the text "null". If a CSV import created literal "null" strings, replace them before stripping.
How do I confirm cleaning didn't drop real data?
Diff the original and cleaned files with json-diff. It lists every removed key so you can verify only nulls/empties were taken.
Can I flatten the cleaned data into columns?
Not in this tool. After stripping, use json-flattener for dot-path keys or json-to-csv for a flat table.
Is there a record limit?
No separate row limit applies to this tool — only the file-size cap (2 MB free, 100 MB Pro). A large array is fine if the file fits.
Why is the output pretty-printed?
Output is 2-space indented for readability and review; the indent isn't configurable. Run it through json-minifier if you need compact JSON for loading or storage.
Privacy first
Conversion runs locally in your browser. No file is uploaded — only metadata counters are saved for signed-in dashboard stats.