String Utilities

Count All Chars

Analyzes text to return frequency counts for every character present. Access via MCP in Cursor or Windsurf, or call GET /v1/string/count-all-chars directly. Returns JSON mapping each character to its occurrence count — useful for cryptographic analysis, data validation, or text processing workflows. Handles Unicode characters and whitespace accurately.

API Endpoint

GET /v1/string/count-all-chars

Code Examples

curl "https://tinyfn.io/v1/string/count-all-chars" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/string/count-all-chars', {
  headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests

response = requests.get('https://tinyfn.io/v1/string/count-all-chars',
    headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)

Use via MCP

Add to your AI agent

Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's string tools:

{
  "mcpServers": {
    "tinyfn-string": {
      "url": "https://tinyfn.io/mcp/string",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

How do I count character frequencies in text using MCP?

Use the count-all-chars tool in any MCP-compatible editor like Cursor or Cline. Pass your text string and get back a JSON object with each character mapped to its count.

What format does count-all-chars return?

Returns JSON object where keys are individual characters and values are their occurrence counts. Example: {"a": 3, "b": 1, " ": 2} for "aaa b".

Does count-all-chars handle Unicode and special characters?

Yes, it accurately counts all Unicode characters including emojis, accented letters, and whitespace characters like spaces, tabs, and newlines.

Can I use this for frequency analysis or cryptography work?

Absolutely. Character frequency analysis is essential for cipher breaking, text classification, and statistical analysis. The deterministic output makes it reliable for security applications.

What's the difference between count-all-chars and regular character counting?

This tool counts every unique character individually, not just letters or words. It's more comprehensive than basic word counting and handles edge cases consistently.

Try Count All Chars Now

Get your free API key and start using Count All Chars in seconds.

Get Free API Key