Word and character counter

Count characters, words, lines, sentences, paragraphs and UTF-8 bytes in a text.

Input

The text to count.

Result

Fill in the input and press Run.

Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.

Use it from code or an agent

curl -s https://setget.net/v1/tools/text-count \
  -H 'Content-Type: application/json' \
  -d '{"input":{"text":"Hello world. How are you?\n\nFine, thanks!"}}'
import json, urllib.request

body = {'input': {'text': 'Hello world. How are you?\n\nFine, thanks!'}}
request = urllib.request.Request("https://setget.net/v1/tools/text-count", json.dumps(body).encode(),
                                 {"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/text-count", {
  method: "POST",
  headers: {"Content-Type": "application/json"},
  body: JSON.stringify({"input":{"text":"Hello world. How are you?\n\nFine, thanks!"}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
  "slug": "text-count",
  "input": {
    "text": "Hello world. How are you?\n\nFine, thanks!"
  }
}
{
  "input": {
    "text": "Hello world. How are you?\n\nFine, thanks!"
  }
}

Endpoint: POST /v1/tools/text-count. Over MCP: run_tool with slug: "text-count". Machine-readable: input schema, Markdown. Connect an agent.

Inputs

NameTypeRequiredWhat it does
text string yes The text to count.

Examples

Input
{
  "text": "Hello world. How are you?\n\nFine, thanks!"
}
Result
{
  "characters": 40,
  "characters_no_spaces": 33,
  "words": 7,
  "lines": 3,
  "sentences": 3,
  "paragraphs": 2,
  "bytes": 40
}

Accented letters take two bytes

Input
{
  "text": "naïve café"
}
Result
{
  "characters": 10,
  "characters_no_spaces": 9,
  "words": 2,
  "lines": 1,
  "sentences": 1,
  "paragraphs": 1,
  "bytes": 12
}

Questions

Why are characters and bytes different?
Letters outside basic English take two to four bytes in UTF-8. An emoji is usually one or two characters but four or more bytes.
What is a word here?
Any run of characters between spaces or line breaks. "well-known" is one word.
How are sentences counted?
By full stops, question marks and exclamation marks followed by a space. Abbreviations such as "Dr. Smith" can add an extra sentence.