{
  "slug": "index-of-coincidence",
  "name": "gizza-ai/index-of-coincidence",
  "version": "0.1.0",
  "title": "Index of Coincidence Calculator — gizza.ai",
  "description": "Calculate the Index of Coincidence (IC) of any text — spot monoalphabetic vs polyalphabetic ciphers and estimate a Vigenère key length. Free, in your browser.",
  "tags": [
    "index of coincidence",
    "ic calculator",
    "cryptanalysis",
    "vigenere",
    "key length",
    "kasiski",
    "frequency analysis",
    "monoalphabetic",
    "polyalphabetic",
    "cipher"
  ],
  "category": "security",
  "urls": {
    "page": "https://gizza.ai/tools/index-of-coincidence/",
    "markdown": "https://gizza.ai/tools/index-of-coincidence/index.md",
    "descriptor": "https://gizza.ai/tools/index-of-coincidence/tool.json",
    "deep_link_example": "https://gizza.ai/tools/index-of-coincidence/?text=Paste%20ciphertext%20or%20plaintext%20here%E2%80%A6&max_period=0&show_counts=true"
  },
  "cli": "gizza tool index-of-coincidence \"Paste ciphertext or plaintext here…\"",
  "tool": {
    "description": "Calculate the Index of Coincidence (IC) of a text — the probability that two randomly drawn letters are the same — to gauge whether it is monoalphabetic, polyalphabetic, or random. Counts only the 26 Latin letters A-Z (case-folded); other characters are ignored. Reports the IC both normalized (English plaintext ~1.73, uniform/random ~1.0) and raw (English ~0.0667, random ~0.0385), plus a plain-language interpretation. Set max_period > 0 to also estimate a Vigenère key length (the period whose average column IC is highest is the likely key length). Set show_counts=true to include a per-letter frequency table.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "max_period": {
          "default": 0,
          "description": "When greater than 0, also estimate the polyalphabetic key length (Vigenère period) by splitting the text into 1..=max_period columns and reporting the average column IC for each — the period with the highest value is the likely key length. 0 (default) skips this analysis. Max 40.",
          "maximum": 40,
          "minimum": 0,
          "type": "integer"
        },
        "show_counts": {
          "default": false,
          "description": "When true, include a per-letter frequency table (count and percentage for each A-Z letter that appears). Default false.",
          "type": "boolean"
        },
        "text": {
          "description": "The text to analyze. Only the 26 Latin letters A-Z are counted (case-folded); digits, spaces, punctuation, and non-Latin characters are ignored.",
          "type": "string"
        }
      },
      "required": [
        "text"
      ],
      "type": "object"
    }
  }
}