> ## Documentation Index
> Fetch the complete documentation index at: https://developer.kodexa.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Stats

> Use kdx document stats to display detailed statistics for a KDDB document, including page count, node types, tag distribution, data objects, and exceptions.

Display detailed statistics about a KDDB document including page count, node type distribution, tag breakdown, data object count, and exception count.

## Usage

```bash theme={null}
kdx document stats <file.kddb> [flags]
```

## Flags

| Flag       | Description                                 | Default   |
| ---------- | ------------------------------------------- | --------- |
| `--page N` | Show stats for specific page only (1-based) | All pages |

## Examples

### Full Document Stats

```bash theme={null}
kdx document stats report.kddb
```

```json theme={null}
{
  "totalPages": 15,
  "totalNodes": 8432,
  "nodeTypeCount": {
    "page": 15,
    "content-area": 15,
    "line": 1200,
    "word": 6500
  },
  "totalTags": 85,
  "totalFeatures": 9200,
  "totalDataObjects": 12,
  "tagCounts": {
    "invoice/amount": 5,
    "invoice/date": 3
  }
}
```

### Per-Page Stats

```bash theme={null}
kdx document stats report.kddb --page 3
```

```json theme={null}
{
  "page": 3,
  "totalNodes": 542,
  "nodeTypeCount": {
    "page": 1,
    "content-area": 1,
    "line": 80,
    "word": 460
  }
}
```

<Tip>
  Use `--page` to identify which pages have the most content or complexity.
</Tip>
