ForHosting KIT · Text & AI

Word & character counter

Paste a draft and see every total at once: «Hello world. This is a test.» plus a second paragraph gives 9 words, 52 characters, 3 sentences and 2 paragraphs. Character counts come with and without spaces. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Text
Hello world. This is a test. Second paragraph here!
You get
Words
9
Characters
52
Characters no spaces
43
Characters with spaces
52

Empty input is rejected with a clear validation error instead of silently returning zeros, which protects clients that forgot to bind a field.

How word, character, sentence, and paragraph counts are computed

Word count splits the text on Unicode whitespace and counts every non-empty token. That matches the status bar in most editors and online counters: a hyphenated token such as well-known counts as one word, and multiple spaces collapse into a single separator. Character count is the full string length, including spaces, tabs, and newlines, so it lines up with hard limits on SMS, tweets, product titles, and form maxLength attributes.

A second total strips all whitespace so you can compare pure content length when spaces would inflate the figure. Sentence count looks for segments that end with a period, exclamation mark, or question mark, optionally followed by a closing quote or bracket, then treats any trailing non-empty fragment without terminal punctuation as one more sentence. Paragraph count splits on blank lines—one or more lines that contain only whitespace—so a double newline starts a new paragraph the same way Markdown and most word processors do.

Line count is the number of newline characters plus one, covering single-line and multi-line inputs alike. Average word length divides non-space characters by word count and rounds to two decimals, or returns zero when there are no words. Because the path is pure parse arithmetic over strings, latency stays sub-millisecond for typical form sizes and the published cost model is analytic rather than model-token based.

What you send and what you get back

Send a single required field named text containing the non-empty string you want measured. Numbers and booleans are coerced to their decimal or true/false text forms; objects, arrays, NaN, and Infinity are rejected. Classic checks include a short greeting such as Hello world becoming one sentence, two words, and eleven characters; multi-sentence drafts with blank-line paragraph breaks; and single-line slogans without terminal punctuation that still count as one sentence.

Empty text fails validation before any counters run and is not charged. Wire the free browser form for paste-and-check work on essays and social copy, then call the identical contract from scripts when you enforce length limits in bulk CSV columns, CMS exports, or moderation queues.

Where word and character counters show up in real work

Students and teachers check essay and abstract limits before submission so a five-hundred-word assignment is neither short nor padded. Content marketers and SEO writers track keyword-rich drafts against title, meta description, and body length targets without opening a full word processor. Social media managers verify character budgets for posts, ads, and bio fields where platforms reject or truncate overlong strings.

Product and growth teams enforce form field maxima and SMS template limits in QA by piping candidate strings through the same counter used in the browser. Editors and translators compare source and target paragraph and sentence density when reviewing localization packages. Data engineers cleaning free-text columns often store word and character totals as derived metrics for quality dashboards.

If you later need keyword density analysis, PDF page and word stats, reading-time estimates, or grade-level scores, treat those as separate search intents and landings rather than overloading this count-words-and-characters page.

Social posts and ad character budgets

Count characters with and without spaces so platform limits and truncated previews never surprise you at publish time.

CMS and form field QA

Pipe product titles, meta descriptions, and free-text fields through one deterministic counter in bulk pipelines.

How are words counted?

Words are non-empty tokens separated by Unicode whitespace. Multiple spaces collapse into one separator. Hyphenated tokens count as a single word.

How are sentences and paragraphs detected?

Sentences end on period, exclamation, or question mark (optionally followed by a closing quote or bracket). A trailing fragment without terminal punctuation still counts as one sentence. Paragraphs are blocks separated by blank lines.

What happens if the text is empty?

Provide a non-empty string; empty boxes are treated as client errors and are not charged.

What does it cost?

The browser tool is free and runs locally.

Which character count should I use for a post or form limit?

Use the count with spaces. It is the full length of the text, including spaces, tabs and line breaks, which is what posts, titles and forms measure. The count without spaces helps compare pure content.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/str/word-count

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/str/word-count \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Hello world. This is a test.\n\nSecond paragraph here!"}'
{
  "text": "Hello world. This is a test.\n\nSecond paragraph here!"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "str.word_count",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

A word and character counter is the everyday checkpoint writers, students, marketers, and engineers use before submitting essays, social posts, product copy, form fields, and API payloads with hard limits. This tool takes the plain text you enter and returns deterministic totals for words, characters with and without spaces, sentences, paragraphs, and lines, plus a simple average word length so you can sanity-check density at a glance.

How word, character, sentence, and paragraph counts are computed

Extremely long payloads above the documented character cap fail with invalid_input so a single request cannot monopolize Worker memory.

What you send and what you get back

Aliases such as input, value, data, s, message, string, content, and body are accepted for convenience when wiring older clients. On success the response echoes the original text and returns words, characters, characters_no_spaces, characters_with_spaces, sentences, paragraphs, lines, average_word_length, and operation set to word_count. Pricing for successful API calls is the published base of $0.002 per item; validation failures including empty text do not consume prepaid balance.

Where word and character counters show up in real work

Because this capability is a pure parse engine, API pricing is the published base of $0.002 per successful item and failed validation does not consume balance.

Essay and assignment length checks

Verify word and paragraph totals against school or conference limits before you submit, with the same counts in browser and API.

What is the difference between characters and characters_no_spaces?

characters (and characters_with_spaces) is the full string length including spaces, tabs, and newlines. characters_no_spaces excludes all whitespace so you can measure pure content length.

Read the full KIT documentation →