{
    "slug": "word-frequency-and-keyword-density-checker",
    "name": "Word Frequency and Keyword Density Checker",
    "url": "https://directory.milunir.com/text-tools/word-counters/word-frequency-and-keyword-density-checker/",
    "description": "Count how often each word or 2–5 word phrase appears, and get the density of one keyword as matches ÷ total words × 100, with a table of the top 20.",
    "inputs": {
        "type": "object",
        "properties": {
            "mode": {
                "type": "string",
                "enum": [
                    "frequency",
                    "density",
                    "phrases"
                ],
                "description": "Mode",
                "default": "frequency"
            },
            "text": {
                "type": "string",
                "description": "Your text"
            },
            "skip_common": {
                "type": "boolean",
                "description": "Skip common words (the, and, of…)",
                "default": true
            },
            "keyword": {
                "type": "string",
                "description": "Keyword or phrase. Matched as whole words, ignoring capital letters.",
                "default": "keyword"
            },
            "phrase_length": {
                "type": "integer",
                "minimum": 2,
                "maximum": 5,
                "description": "Words per phrase",
                "default": 2
            }
        },
        "additionalProperties": false,
        "required": [
            "text"
        ]
    },
    "outputs": [
        {
            "key": "primary",
            "label": "Top keyword or density"
        },
        {
            "key": "total_words",
            "label": "Total words"
        },
        {
            "key": "distinct",
            "label": "Different words"
        },
        {
            "key": "occurrences",
            "label": "Keyword matches"
        },
        {
            "key": "repeated",
            "label": "Repeated items"
        }
    ],
    "modes": [
        {
            "id": "frequency",
            "label": "Word frequency",
            "inputs": [
                "text",
                "skip_common"
            ]
        },
        {
            "id": "density",
            "label": "Keyword density",
            "inputs": [
                "text",
                "keyword"
            ]
        },
        {
            "id": "phrases",
            "label": "Phrases",
            "inputs": [
                "text",
                "phrase_length"
            ]
        }
    ],
    "feed": null,
    "endpoint": "https://api.tools-directory.workers.dev/v1/tools/word-frequency-and-keyword-density-checker",
    "mcp_tool": "word_frequency_and_keyword_density_checker",
    "example": {
        "inputs": {
            "mode": "frequency",
            "text": "The cat and the hat and the bat.",
            "skip_common": false
        },
        "output": "Top keyword or density: the\nTotal words: 8\nDifferent words: 5"
    }
}