{
    "name": "Tukey Fence Outlier Calculator",
    "url": "https://calculators.geekmidst.com/calculators/outlier-tukey-fence-calculator",
    "markdown": "https://calculators.geekmidst.com/calculators/outlier-tukey-fence-calculator.md",
    "category": "Statistics & probability",
    "description": "Find outliers with Tukey’s fences: Q1 − k×IQR and Q3 + k×IQR, with k = 1.5 for outliers and 3 for far-out values, and the quartile method stated.",
    "summary": "Tukey’s rule flags any value more than 1.5 interquartile ranges below Q1 or above Q3, the same rule box plots use for their whiskers.",
    "also_called": [
        "IQR outlier calculator",
        "Upper and lower fence calculator"
    ],
    "applies_to": "Worldwide",
    "last_updated": "2026-10-29",
    "computation": "Results are computed in the visitor’s browser on the HTML page. This API describes the calculator; it does not compute results.",
    "inputs": [
        {
            "name": "values",
            "label": "Numbers",
            "type": "textarea",
            "default": "2, 4, 4, 4, 5, 5, 7, 9, 30"
        },
        {
            "name": "k",
            "label": "Fence multiplier k",
            "type": "number",
            "default": "1.5"
        },
        {
            "name": "method",
            "label": "Quartile method",
            "type": "select",
            "default": "type7",
            "options": {
                "type7": "Inclusive / linear (Excel QUARTILE.INC, R default)",
                "type6": "Exclusive (Excel QUARTILE.EXC)",
                "tukey": "Tukey hinges"
            }
        }
    ],
    "outputs": [
        {
            "key": "outlier_count",
            "label": "Outliers found",
            "format": "integer"
        },
        {
            "key": "outliers",
            "label": "Outlying values",
            "format": "text"
        },
        {
            "key": "lower_fence",
            "label": "Lower fence",
            "format": "number"
        },
        {
            "key": "upper_fence",
            "label": "Upper fence",
            "format": "number"
        },
        {
            "key": "q1",
            "label": "Q1",
            "format": "number"
        },
        {
            "key": "q3",
            "label": "Q3",
            "format": "number"
        },
        {
            "key": "iqr",
            "label": "IQR",
            "format": "number"
        },
        {
            "key": "far_out_count",
            "label": "Far-out values (beyond 3 × IQR)",
            "format": "integer"
        }
    ],
    "formula": {
        "text": "IQR = Q3 − Q1;  lower fence = Q1 − k × IQR;  upper fence = Q3 + k × IQR;  outlier if x < lower or x > upper",
        "variables": {
            "Q1, Q3": "first and third quartiles",
            "k": "multiplier: 1.5 (outlier) or 3 (far out)"
        }
    },
    "worked_example": {
        "inputs": {
            "values": "2, 4, 4, 4, 5, 5, 7, 9, 30",
            "k": "1.5",
            "method": "type7"
        },
        "steps": [
            "Q1 = 4 and Q3 = 7 (inclusive method), so IQR = 3.",
            "Fences: 4 − 1.5 × 3 = −0.5 and 7 + 1.5 × 3 = 11.5.",
            "Only 30 lies outside; it is also beyond 7 + 3 × 3 = 16, so it is far out."
        ],
        "result": "One outlier, 30, lies above the upper fence of 11.5."
    },
    "interpretation": "A flagged value is a prompt to investigate, not to delete: check for data-entry errors, unit mix-ups or a genuinely different case before deciding what to do.",
    "assumptions": [
        "Tukey’s fences make no normality assumption; for normal data about 0.7% of values fall outside the 1.5 × IQR fences by chance."
    ],
    "limitations": [
        "In small or heavily skewed samples the rule may flag legitimate values; the quartile method also shifts the fences slightly."
    ],
    "rules": null,
    "faqs": [
        {
            "question": "Why 1.5?",
            "answer": "Tukey chose it as a practical compromise: for normal data the fences sit about 2.7 standard deviations from the mean."
        },
        {
            "question": "Should I remove outliers?",
            "answer": "Only with a reason, such as a proven measurement error. Otherwise report results with and without them, or use robust statistics like the median."
        }
    ],
    "sources": [],
    "related": [
        {
            "name": "Interquartile Range Calculator",
            "url": "https://calculators.geekmidst.com/calculators/interquartile-range-calculator"
        },
        {
            "name": "Median Absolute Deviation Calculator",
            "url": "https://calculators.geekmidst.com/calculators/median-absolute-deviation-calculator"
        },
        {
            "name": "Z-score Calculator",
            "url": "https://calculators.geekmidst.com/calculators/z-score-calculator"
        },
        {
            "name": "Statistics Calculator",
            "url": "https://calculators.geekmidst.com/calculators/statistics-calculator"
        }
    ],
    "disclaimer": null,
    "publisher": "GM¹X CalcVerse"
}