ForHosting KIT · Text & AI

Count hashtags

“Launch day! #product #launch #startup” holds 3 hashtags, listed in order with their original capitals. A tag is # followed by letters, digits or underscores, so you can check a caption against a per-post limit before it goes live. 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
Launch day! #product #launch #startup
You get
Quantity
3
Hashtags
#product, #launch, #startup
Unique
#product, #launch, #startup
Unique count
3

This hashtag counter scans any non-empty text string and reports how many hashtags it contains by matching a hash symbol followed by word characters—letters, digits, and underscores. Social media managers, content calendars, community teams, and analytics scripts use exact hashtag tallies every day to stay inside platform limits, balance branded versus campaign tags, and keep posting guidelines consistent across channels. The engine is fully deterministic: it walks the string with a fixed pattern, never calls the network, samples randomness, or depends on the current date. Text with no hashtags is a valid success and returns count zero, which is useful when you need to prove a caption is tag-free before publish.

Counting hashtags answers a focused product question: how many times does a social-style tag appear in this caption, thread draft, or document fragment. On this page a hashtag is defined strictly as a hash symbol immediately followed by one or more word characters.

Word characters are letters, decimal digits, and the underscore, so tags such as #launch, #Q3_report, and #2026goals all match, while a lone hash mark, a hash glued only to punctuation, or a hash followed by a hyphenated segment that is not word characters does not form a full tag under this rule. For example, the fragment #hello-world contributes the match #hello because the hyphen stops the word-character run; ##double contributes #double from the second hash onward when the following characters are word characters.

There is no ranking of trending topics, no suggestion engine, no network lookup of platform popularity, and no silent coercion of null into an empty success.

Where hashtag counts fit in social planning, QA, and software

Marketers and community managers meet hashtag limits when a channel caps the number of tags per post, when a brand book requires a fixed set of campaign tags, or when a content calendar must prove that every asset carries the quarterly brand tag exactly once. Editorial QA can paste captions into a counter before publish so over-tagged drafts fail a checklist instead of going live with ten campaign tags and two typos.

Agencies comparing client drafts need a deterministic number they can drop into a brief rather than a hand count that drifts when someone re-edits the same paragraph. Developers call the same contract from scripts to validate form fields that collect social copy, seed deterministic test vectors for posting tools, assert exact tag lists in end-to-end tests, or satisfy programming-challenge statements that demand a hashtag tally rather than a screenshot. Support and operations teams measure noisy ticket subjects and log lines when a policy forbids hashtags in certain templates.

Pair it with character-count, line-count, or keyword-density tools when you are building a small lab of free, deterministic text helpers for social QA, CMS prep, and publishing hygiene.

Social post limit checks

Tally #tags in a caption or thread before publish so drafts stay inside platform and brand hashtag limits.

What counts as a hashtag?

A hash symbol immediately followed by word characters. Examples: #launch, #Q3_report, #2026goals. A lone # or # glued only to punctuation does not match. #hello-world matches #hello only because the hyphen stops the word run.

Are hashtag matches case-sensitive?

Matches keep original casing in the hashtags array. The unique list collapses tags case-insensitively while preserving the first spelling seen, so #Launch and #launch count as two occurrences but one unique tag.

What happens with a hyphenated tag like #hello-world?

Only #hello is counted, because the hyphen ends the tag. Letters, digits and underscores keep a hashtag going; any other character, such as a hyphen or a space, closes it.

Can I check that a caption has no hashtags at all?

Yes. Text without any hashtag is a valid result and simply returns zero, which lets you prove a caption carries no tags before it is published.

Does it show which hashtags it found?

Yes. You get every hashtag in the order it appears, with its original capitals, plus a list of unique tags in which tags that differ only in capitals are merged under the spelling seen first.

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-hashtags

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-hashtags \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Launch day! #product #launch #startup"}'
{
  "text": "Launch day! #product #launch #startup"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "str.count_hashtags",
  "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.

Empty input is rejected with a clear invalid_input error so a blank form field cannot become a silent zero success. Use it free in the browser for quick post audits, or call the API at $0.002 per successful request when you need reproducible tallies in CI, scheduling tools, or content pipelines.

What counting hashtags means and what the response contains

The calculator returns the echoed text, the integer count of matches, the ordered hashtags array preserving occurrence order and original casing, a unique array that collapses case-insensitive duplicates while keeping the first spelling seen, the unique_count integer, and the fixed method tag count_hashtags for logs and multi-tool pipelines. The engine either builds exact metrics inside the supported length or rejects the request with invalid_input. Rejected cases include a missing text field, a null value, an empty string, objects and arrays that are not plain text, and any payload longer than the documented maximum character count.

How the text field is read and how counts stay reproducible

The value must be a non-empty string; finite numbers and bigints are stringified first so a bare numeric paste still produces a stable string to scan, though pure numbers rarely contain hashtags. Matching uses a single global regular expression with fixed word-character membership—no network dictionary, no machine-learning model, and no locale tables that could drift between hosts. The preferred field is text, but aliases input, string, value, content, and s are accepted so query strings, spreadsheets, CMS exports, and typed forms can reuse the same contract without renaming columns. Booleans, plain objects, and arrays are rejected with a clear message so a mistaken JSON body does not become the word true or an unhelpful object dump. Empty string is always invalid_input: the product promise is count hashtags in text, not invent a zero success for a blank submit. Length is capped at one hundred thousand characters so a runaway paste cannot monopolize a Worker; longer payloads fail with an explicit limit message rather than a truncated silent cut. Pair the free browser run on this page with the priced API when you need the identical tallies inside an automated pipeline without shipping your own hashtag scanners.

Where hashtag counts fit in social planning, QA, and software

On this page the work runs entirely in your browser; through the API each successful count costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split—free interactive exploration and a priced, identical API—matches the rest of the KIT tier-A catalog and lets you move from a planning demo to an automated pipeline without changing the numeric result.

Content calendar and campaign QA

Verify that every asset includes the required campaign tags and report unique_count for brand-book compliance.

Deterministic test fixtures

Generate reproducible hashtag counts and ordered tag lists for unit tests, goldens, and CI assertions in posting tools.

How do you count hashtags in text?

Send a non-empty text string. The API matches each # followed by one or more word characters (letters, digits, underscore) and returns count, the ordered hashtags list, unique tags, and unique_count.

What if my text has no hashtags?

That is a valid success: count is 0, hashtags and unique are empty arrays, and unique_count is 0. Only missing or empty text is rejected as invalid_input.

What does the hashtag counter cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →