Counts characters in any string with UTF-8 support for accurate length calculation. Use via MCP in Cursor or Windsurf for instant string analysis, or call GET /v1/string/length with your text. Returns precise character count including emojis and unicode — "Hello 👋" gives 7, not 8 bytes.
curl "https://tinyfn.io/v1/string/length" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/string/length', {
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/length',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
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"
}
}
}
}
Counts actual characters, not bytes. '🚀✨' returns 2, and 'café' returns 4 characters correctly.
Yes, works natively in Cursor, Claude Code, Windsurf, and other MCP tools for instant character counting during development.
JavaScript can miscalculate unicode. This tool guarantees accurate UTF-8 character counting regardless of string content.
Counts all characters including spaces, tabs, newlines, and special symbols. 'hello world' returns 11.
Empty strings return 0. Handles large text efficiently without practical length limits.
Get your free API key and start using String Length in seconds.
Get Free API Key