SmartQueryTools

Detect Outliers in JSON Files Online

Detect statistical outliers in JSON files directly in your browser. Flag or remove rows where numeric values exceed a chosen number of standard deviations from the mean — no upload required.

How to detect Outliers in JSON files

  1. Drop your file onto the upload area. It is loaded into the in-browser engine and the first 200 rows are shown.
  2. Pick a threshold in standard deviations from the mean: 1.5σ, 2σ (the default), 2.5σ or 3σ.
  3. Pick an action: Flag outliers adds an is_outlier column, Keep outliers returns only the outlier rows, and Remove outliers returns the rest.
  4. Choose the columns to check. Every numeric column is selected to start with. Click a column to toggle it, or use All and None. A row counts as an outlier if any selected column is beyond the threshold.
  5. Click Detect Outliers. The count shows how many rows were flagged, kept or left. Review the result, then download it in the same format you uploaded.

Your file is processed locally in your browser and is never uploaded. The free limit is 50 MB per file; larger files work if your device has the memory for them.

Worked example

A food distributor logs one temperature reading from each of six freezer units. One unit has a failing compressor and reads far warmer than the rest.

Input (JSON)

[
  {
    "unit": "FZ-01",
    "location": "Bay 1",
    "temp_c": -18.2
  },
  {
    "unit": "FZ-02",
    "location": "Bay 1",
    "temp_c": -18.6
  },
  {
    "unit": "FZ-03",
    "location": "Bay 2",
    "temp_c": -17.9
  },
  {
    "unit": "FZ-04",
    "location": "Bay 2",
    "temp_c": -18.4
  },
  {
    "unit": "FZ-05",
    "location": "Bay 3",
    "temp_c": -9.5
  },
  {
    "unit": "FZ-06",
    "location": "Bay 3",
    "temp_c": -18.1
  }
]

Settings

  • Threshold: 2σ
  • Action: Flag outliers
  • Columns to check: temp_c (the only numeric column)

Result

unitlocationtemp_cis_outlier
FZ-01Bay 1-18.2false
FZ-02Bay 1-18.6false
FZ-03Bay 2-17.9false
FZ-04Bay 2-18.4false
FZ-05Bay 3-9.5true
FZ-06Bay 3-18.1false

The mean is −16.78 °C and the sample standard deviation is 3.58 (both rounded), so 2σ is 7.15 degrees. FZ-05 is 7.28 above the mean, a z-score of 2.04, so it is flagged. The faulty reading also inflates the mean and the deviation it is judged against. At 2.5σ nothing would be flagged in a file this small.

Working with JSON files

Top-level keys that hold numbers in every object are listed as columns to check. A key that mixes numbers and quoted strings is loaded as a JSON-typed column and is left out. So is any number nested inside an object, such as metrics.latency_ms. Flatten the file first to check nested values. API logs often have this shape. Integers and decimals in the same key are fine and load as one numeric column. Booleans are not numeric, so true and false keys are never checked.

Objects that lack a checked key are treated as null for it. They do not affect the mean or standard deviation, and null is never an outlier. So in Flag mode they get false unless another checked key flags them, and Remove outliers keeps them. In Flag mode the output array keeps every object and appends is_outlier as the last key, with the value true or false.

Frequently Asked Questions

Can I check a nested JSON value such as metrics.latency_ms?

Not directly. Only top-level numeric keys are listed. Flatten the JSON first so the nested value becomes its own key.

What does is_outlier show for JSON objects missing a key?

false, because a missing value is not an outlier. Another checked key can still flag the object as true.

Which method does the tool use?

A z-score test. A value is an outlier when it is more than the chosen number of sample standard deviations away from its column's mean. The mean and deviation come from the whole file. IQR and median-based methods are not offered.

Why are no outliers found at 3σ in my small file?

With n rows, no value can be more than (n − 1) / √n sample standard deviations from the mean. That means 2σ needs at least 6 rows, 2.5σ needs 9, and 3σ needs 11 before anything can be flagged at all. Extreme values also inflate the deviation they are measured against.

How are blank values handled?

They are ignored when the mean and deviation are computed, and a blank is never an outlier. In Flag mode the row gets false unless another column flags it. Remove outliers keeps the row, and Keep outliers leaves it out.

Related Tools