ForHosting KIT · Text & AI

Count specific character occurrences in text

This specific character counter tells you exactly how many times one chosen character appears in a piece of text.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

Enter any text, choose a single letter, number, punctuation mark, space, symbol, or emoji, and decide whether uppercase and lowercase forms should be treated as different. The result is a direct occurrence count, with no pattern syntax and no hidden word-level rules. It is useful for editing, data checks, classroom exercises, formatting audits, and small automation tasks where a general character total does not answer the real question.

Count one character without pattern-matching surprises

A general character counter measures the whole length of a passage, but many practical questions concern one particular mark. You may need to know whether a code was padded with the expected number of zeroes, whether a line contains too many commas, or how often a letter appears in a writing exercise. This tool accepts the source text and one target character, then walks through the text and adds one for every match. The target is interpreted literally. A period means a period, an asterisk means an asterisk, and a bracket means a bracket; none of them becomes a regular-expression command. Spaces, line breaks, accented letters, and emoji are valid targets as long as the target contains exactly one Unicode character. Empty source text is also valid and returns zero, which makes the result predictable in automated pipelines. The response repeats the target and selected case mode beside the count, so stored results remain understandable without reconstructing the original request settings.

Choose exact case or ignore letter case

Exact matching is the default because it preserves the text as written. With that setting, uppercase A and lowercase a are different characters, so counting one does not include the other. Enable case-insensitive matching when the distinction is irrelevant, such as when reviewing how frequently a letter is used regardless of capitalization at the beginning of sentences. The option changes comparison only; it does not remove accents, normalize punctuation, trim whitespace, or convert similar-looking symbols into one another. That narrow behavior is important because visual similarity does not always mean textual identity. The algorithm iterates through Unicode code points, allowing a supplementary character such as a common emoji to be supplied and counted as one target. Case handling uses standard Unicode case mappings and does not choose a regional locale. For scripts or symbols without uppercase and lowercase variants, enabling the flag normally produces the same count as exact matching. This keeps the control useful while making its scope explicit and testable.

Use the result in checks, lessons, and automation

The counter works well as a quick browser utility and as a small deterministic step inside a larger workflow. Editors can count quotation marks or dashes before publication. Developers can check delimiters in diagnostic samples without writing a temporary script. Teachers and students can verify letter-frequency exercises while still discussing why capitalization changes an exact result. Data teams can inspect a field for a separator before deciding how to parse it. Because the operation is literal and returns only a compact object, downstream code can compare the count with an expected minimum or maximum and make a clear decision. The API request costs $0.002, while the browser runner is suitable for interactive checks. No network source is consulted by the algorithm, and the answer does not depend on randomness or the current time. For reliable integrations, send the target as a single character rather than a word or substring; multi-character targets are rejected with an input error instead of being interpreted ambiguously.

Audit delimiters

Count commas, tabs, pipes, or semicolons in a sample before selecting a parser configuration.

Check writing exercises

Measure how often a selected letter occurs, with capitalization included or separated as needed.

Validate formatting

Confirm that a template contains the expected number of quotation marks, bullets, spaces, or symbols.

What does it cost?

Each API request costs $0.002. The browser runner can be used for interactive checks.

Can I count a word or substring?

No. The target must be exactly one Unicode character; longer targets return an invalid input error.

Does uppercase match lowercase?

Only when case_insensitive is true. By default, uppercase and lowercase characters are counted separately.

Can the target be a space or emoji?

Yes. Any target represented by one Unicode code point is accepted, including a space, symbol, or supplementary emoji.

What happens with empty text?

Empty source text is valid and returns a count of zero, provided the target character is valid.

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/text/count-specific-character

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/text/count-specific-character \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Banana bread","character":"a"}'
{
  "text": "Banana bread",
  "character": "a"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "text.count_specific_character",
  "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.

Read the full KIT documentation →