Count paragraphs in text
Paste three paragraphs separated by blank lines and get 3 paragraphs with 6, 4 and 5 words, 15 in total. Hard-wrapped lines stay in one paragraph and extra blank lines never add empty ones, so the count matches what a reader sees. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Writers, editors, teachers, and content pipelines often need more than a single paragraph total: they need a breakdown of how many words sit in each blank-line block so they can balance essay structure, check assignment rules, or split work across translators. This capability accepts plain text whose paragraphs are separated by blank lines, counts every non-empty block, and returns the word count of each paragraph in order. Use it when the search intent is count paragraphs in text, words per paragraph, or a blank-line paragraph analyzer with a clear per-block word list.
How blank-line paragraphs and word counts are defined
In plain text, a paragraph is conventionally a block of non-empty content separated from the next block by at least one blank line. This tool follows that everyday definition rather than guessing sentence boundaries, HTML tags, or NLP topic breaks. First the input is validated: missing text, a non-string value, or a string that is empty after trimming whitespace is rejected with a clear error.
Newlines are normalized so Windows CRLF, old Mac CR, and Unix LF all become a single LF form before splitting. The splitter then looks for one or more consecutive lines that are empty or contain only spaces or tabs; those runs are the paragraph breaks. Each remaining block is trimmed of outer blank edges; if anything non-whitespace remains, it counts as one paragraph.
Leading blank lines, trailing blank lines, and double or triple spacing between blocks never create empty paragraphs, so a document that starts with two blank lines still begins counting at the first real block. A single long block with only hard wraps—newlines but no blank line—is still one paragraph even when it spans many visual lines. That matches how most style guides and Markdown editors treat prose when authors separate ideas with a blank line.
Word counts use whitespace tokenization: each sequence of non-whitespace characters inside a paragraph is one word, so punctuation attached to a token stays with that token.
When to use this tool and practical tips
Use this capability when the search intent is count paragraphs in text, words per paragraph online, or a free blank-line paragraph analyzer with a per-block word breakdown. Paste a draft essay, convert once, and show students or editors both the paragraph total and how long each block is next to a length target.
Keep intentional single-spaced hard wraps in mind: lines joined only by a single newline stay one paragraph, which is correct for reflowed plain text and wrong only if you meant each visual line to be its own paragraph—in that case insert blank lines first or use a line counter instead. HTML and Markdown source with tags still counts blank lines in the raw string; strip markup first if you want prose-only blocks.
This landing is not a pure sentence counter, not a PDF page stats tool, and not an NLP topic segmenter that invents breaks without blank lines. Prefer a dedicated word-only counter when you need aggregate metrics without structure; prefer this capability when humans already separated ideas with blank lines and you need both the total and the words in each block. When teaching writing structure, compare the same text with and without blank lines so learners see how spacing defines paragraph boundaries and how word mass is distributed across sections.
What you can do with it
Essay structure and homework checks
Students paste draft prose; teachers or LMS scripts confirm paragraph totals and words per paragraph against assignment rules before submission.
FAQ
What happens if the text is empty?
Empty or whitespace-only strings are rejected and not billed so blank form posts never look like success.
Do hard-wrapped lines without a blank line count as multiple paragraphs?
No. Single newlines inside a block stay in the same paragraph. Only blank-line breaks create a new paragraph boundary.
Do extra blank lines create empty paragraphs?
No. Leading and trailing blank lines, and double or triple spacing between blocks, never produce empty paragraphs. Lines that hold only spaces or tabs also count as blank, so counting starts at the first real block.
How are words inside each paragraph counted?
Every run of characters between spaces is one word, so punctuation stays attached to its word. Adding up the counts of all paragraphs gives the total number of words for the whole document.
Does it matter whether my text comes from Windows, Mac or Unix?
No. The different kinds of line endings are converted to one form before the text is split, so the same document gives the same paragraph count wherever it was written.
Related tools
For developers — API access
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.
API endpoint
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.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/text/count-paragraphs \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"First paragraph with five words here.\n\nSecond block has four words."}'const res = await fetch("https://api.kit.forhosting.com/text/count-paragraphs", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"text": "First paragraph with five words here.\n\nSecond block has four words."
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/text/count-paragraphs",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"text": "First paragraph with five words here.\n\nSecond block has four words."
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/text/count-paragraphs", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"text":"First paragraph with five words here.\\n\\nSecond block has four words."}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"text":"First paragraph with five words here.\n\nSecond block has four words."}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/text/count-paragraphs", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"text": "First paragraph with five words here.\n\nSecond block has four words."
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "text.count_paragraphs",
"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.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_chars | 100000 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Empty or whitespace-only input is rejected with invalid_input so automation never treats a blank paste as a successful zero.
How blank-line paragraphs and word counts are defined
Summing words_per_paragraph yields total_words for the whole document.
Input contract, response shape, and pricing
A short message summarizes how many paragraphs and words were counted. Prefer sending the raw document body rather than pre-collapsing newlines when you want true blank-line semantics; collapsing everything to one line would force a single paragraph. Send a JSON body with a required string field text (aliases input, value, string, s, content, and body). The value must be a non-empty string after whitespace is trimmed and must not exceed one hundred thousand characters so a single request cannot exhaust Worker or browser memory on huge paste dumps. On success the response echoes input as the original string you sent and text as the trimmed working string. It returns paragraph_count and count as the same integer total of blank-line blocks, total_words as the sum of words across all paragraphs, words_per_paragraph as an ordered array of integers (one entry per paragraph), paragraphs as the ordered block strings after splitting, and details as an array of objects with index starting at one, text, and word_count for display-friendly tables. Failed validation—missing text, a non-string value, an oversize payload, or empty content after trim—returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request with unit item and no marginal unit price. When integrating, assert on paragraph_count and words_per_paragraph for structure checks, optionally compare total_words to the sum of the per-paragraph array, and treat invalid_input as a client bug for blank form submissions rather than a billing event.
When to use this tool and practical tips
Round-trip checks for tests are easy: feed two short lines separated by a blank line and expect paragraph_count two with two word counts; feed one unbroken block and expect one paragraph; deliberately send empty string or spaces to confirm invalid_input and the message that asks for a non-empty string. Failed tasks that return invalid_input do not consume prepaid balance, which keeps form validation and CI negative tests cheap.
Integration use cases
CMS and translation handoffs
Split multi-block release notes or blog drafts, assert paragraph_count, and allocate translator load using words_per_paragraph before publishing.
Unit tests for text processors
Generate known-good multi-paragraph fixtures with expected word arrays and empty-input rejections for editors, email parsers, and markdown pipelines.
Technical questions
How do you count paragraphs in text?
Send a non-empty string in text. The API splits on blank lines (one or more empty or whitespace-only lines), drops empty blocks, and returns paragraph_count plus words_per_paragraph for each block.
How are words counted in each paragraph?
Each sequence of non-whitespace characters inside a paragraph is one word. words_per_paragraph lists those integers in order; total_words is their sum.
What does count paragraphs in text cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.