---
title: ESTIMATED_TOKEN_COUNT
url: https://www.tines.com/docs/formulas/functions/estimated-token-count/
kind: formula-function
---

*[tines.com](https://www.tines.com/llms.txt) › [Docs](https://www.tines.com/llms.txt) › [Formulas](https://www.tines.com/llm/docs/formulas.md) › [Functions](https://www.tines.com/llm/docs/formulas/functions.md)*

# ESTIMATED_TOKEN_COUNT

*[View on tines.com](https://www.tines.com/docs/formulas/functions/estimated-token-count/)*

Estimates the number of tokens which would represent the input data when passed to a Claude 3 LLM. The token count is an estimate based on an older Claude tokenizer and will not be an exact match for the tokens used.

The formula will error if the input contains more than 1 million characters.

**Categories:** Text, Objects, Arrays, Numbers

## Syntax

```
ESTIMATED_TOKEN_COUNT(input)
```

## Examples

### Example 1

Formula:

```
ESTIMATED_TOKEN_COUNT('Hi! Welcome to Tines')
```

Output:

```json
6
```

### Example 2

Input:

```json
{
  "fetch_items": {
    "data": [
      {
        "finding": "A",
        "severity": "High"
      },
      {
        "finding": "B",
        "severity": "Medium"
      },
      {
        "finding": "C",
        "severity": "Low"
      }
    ]
  }
}
```

Formula:

```
ESTIMATED_TOKEN_COUNT(fetch_items.data)
```

Output:

```json
28
```

## Sample actions

```json
{
  "standardLibVersion": "56",
  "actionRuntimeVersion": "12",
  "agents": [
    {
      "disabled": false,
      "name": "Get token count",
      "description": null,
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "count": "=ESTIMATED_TOKEN_COUNT('Hi! Welcome to Tines')"
        }
      },
      "position": {
        "x": 2220,
        "y": 705
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "caseConfiguration": {
        "subStatus": null
      },
      "recordType": null,
      "recordWriters": [],
      "form": null,
      "createdFromTemplateGuid": null,
      "createdFromTemplateVersion": null,
      "originStoryIdentifier": "cloud:b1120da8923a44bfb8d4c7c31252441d:7ebe309e78ac98c1b94d0a4f071c4e50"
    }
  ],
  "links": [],
  "diagramNotes": []
}
```
