Word and character counter
Count characters, words, lines, sentences, paragraphs and UTF-8 bytes in a text.
Input
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
| Name | Type | Required | What 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.
Related tools
- Token estimatorEstimate how many LLM tokens a text uses, from its characters and words. An approximation, not an exact count.
token-estimate - Word frequency counterCount how often each word appears in a text and list the most common ones, optionally skipping stop words.
word-frequency - Readability scoreScore English text with Flesch reading ease and Flesch-Kincaid grade, with a plain-language verdict.
readability-score - Apply a patchApply a unified diff to a text and get the patched result, with clear errors when a hunk does not fit.
patch-apply - Case converterConvert text between lower, UPPER, Title, Sentence, camelCase, PascalCase, snake_case, kebab-case and more.
case-convert - Escape and unescape textEscape or unescape text for HTML, URLs, JSON strings, shell commands, regular expressions and CSV fields.
escape-unescape