ForHosting KIT · Text & AI

Count consonants in text

“Bright stars shine at night! 2026” has 17 consonants: vowels, spaces, the exclamation mark and the digits are left out, and a capital B counts like b. Handy for phonics sheets, poems and word puzzles. 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
Bright stars shine at night! 2026
You get
Consonants
17

This consonant counter gives you one clear answer: the number of English consonant letters in a piece of text. It ignores the vowels a, e, i, o, and u, as well as digits, spaces, punctuation, symbols, emoji, and non-ASCII characters. The result is useful when checking phonics exercises, studying the sound and letter balance of poetry, preparing word puzzles, or testing text-processing code. The calculation is deterministic and runs in a single pass, so the same input always produces the same integer.

What the consonant counter includes and excludes

The counter includes the twenty-one ASCII English letters that are not a, e, i, o, or u. In practical terms, b through z are tested case-insensitively and counted whenever they belong to that consonant set. Uppercase and lowercase forms are equivalent, so B and b each add one to the result.

The letter y counts as a consonant because this tool uses a fixed character rule rather than trying to infer pronunciation from a word. Every vowel is excluded, even when it appears in uppercase. Decimal digits, spaces, tabs, line breaks, punctuation marks, currency signs, mathematical symbols, and emoji are also excluded.

Non-ASCII letters, including accented characters, are not classified as English consonants and therefore do not increase the count. The tool does not estimate syllables, identify consonant sounds, analyze digraphs, or decide whether a letter is silent. It counts written characters according to a stable English alphabet rule, which is the useful level of precision for letter puzzles and mechanical text analysis.

How to submit text and interpret the result

Whitespace-only text is valid because it is real text under the contract, but its consonant count is zero. The same is true for a string made entirely of vowels, numbers, or punctuation. The algorithm visits each Unicode character once, normalizes only ASCII uppercase letters for comparison, rejects the five fixed vowels, and increments the counter for each remaining ASCII letter.

It never trims the input or changes its contents before scanning. A phrase such as “Bright stars” counts the consonant letters in both words while ignoring its space and vowels; adding 2026 or an exclamation mark does not change the answer. Because the implementation uses no dictionary, locale table, machine-learning model, network request, random value, or clock, repeated calls are deterministic.

Using consonant counts for language, poetry, and puzzles

A consonant total is a small measurement with several practical uses. Teachers can verify phonics worksheets and spelling activities without recounting every letter by hand, while students can check their own work and focus on why particular letters belong in the consonant group. Poetry readers and writers can compare lines with dense clusters of consonants, explore alliteration, or collect simple quantitative notes before performing a deeper analysis of rhythm and sound.

Puzzle makers can confirm constraints for riddles, word ladders, acrostics, and letter-selection games, and solvers can test candidate phrases quickly. Remember that this is an orthographic counter, not a phonetic transcription engine: it sees written letters and does not know that the same consonant can have different sounds or that two letters may form one sound. Run occasional checks free in the browser.

Since the calculation stores nothing and needs no outside service, it is also a straightforward choice for predictable, privacy-conscious text checks.

Check phonics exercises

Verify consonant totals in words and sentences while keeping vowels and non-letter characters out of the answer.

Explore poetic texture

Compare consonant density across lines as a starting point for studying alliteration, clusters, and sound patterns.

Which letters count as consonants?

The twenty-one ASCII English letters other than a, e, i, o, and u count, regardless of case. The letter y counts as a consonant.

Are vowels, digits, and symbols included?

No. Vowels, digits, whitespace, punctuation, symbols, emoji, and non-ASCII characters are excluded.

Does it count consonant sounds or syllables?

No. It counts written ASCII consonant letters and does not interpret pronunciation, silent letters, digraphs, or syllables.

Can I submit empty text?

A non-empty string containing only spaces is valid and returns zero.

Are accented letters counted as consonants?

No. Only the twenty-one unaccented English consonants count, in capitals or lowercase. Accented and other non-English letters are left out, so text in another language may show fewer consonants than you expect.

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/count-consonants

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/count-consonants \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Bright stars shine at night! 2026"}'
{
  "text": "Bright stars shine at night! 2026"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "str.count_consonants",
  "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.

max_chars100000
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.

Try it free in the browser, or automate repeated checks through the API for $0.002 per successful request.

What the consonant counter includes and excludes

These explicit boundaries make the answer reproducible across browsers, API clients, operating systems, and test suites. The response contains only the consonants integer, keeping it easy to place in a worksheet answer, spreadsheet cell, validation rule, or program assertion.

How to submit text and interpret the result

Send a JSON object with a text field containing the material you want to examine. The field must be a string and must contain at least one character; an omitted field, a non-string value, or an empty string produces an invalid_input error instead of a misleading zero. Input is limited to one hundred thousand characters so an accidental oversized paste cannot consume unbounded Worker time.

Using consonant counts for language, poetry, and puzzles

When a script, learning platform, or publishing workflow needs repeatable processing, each successful API request costs $0.002; failed validation is not a successful count.

Build and solve word puzzles

Confirm exact consonant constraints for riddles, letter games, classroom challenges, and deterministic test fixtures.

What does the API cost?

The browser tool is free. Each successful API request costs $0.002; invalid requests are not successful counts.

Read the full KIT documentation →