PixelTidy
← Back to PixelTidy field notes

How to Test a Word Counter: An Accuracy-First Strategy

Table of contents
AI-generated illustration; not taken on location · Accuracy-first word counter testing strategy diagram
AI-generated illustration; not taken on location · A conceptual diagram illustrating systematic checks for word counter accuracy, including probe strings, privacy verification, and local execution.AI-generated illustration

Word counters do not all count the same way. Two tools can display different totals for identical text because they apply different boundaries to letters, punctuation, numbers, and scripts. Relying on a single counter before publishing risks mismatched expectations with editors, clients, or platforms that enforce word limits.

An accuracy-first workflow starts by understanding the tool’s counting rules, then verifying those rules with controlled probe strings. Users can also inspect how text is processed to determine whether it remains private in the browser or is transmitted to a server. This guide outlines that testing strategy step by step and explains what to check when counts disagree across tools.

Tokenization and Counting Rules

Tokenization is the process a word counter uses to decide where one word ends and another begins. It affects word, character, and sentence totals. Some tools count any run of Unicode letters or numbers as a word, while others split on punctuation, spaces, or script changes. Sentence boundaries may depend on terminal punctuation or capitalization patterns, and character counts may or may not include spaces depending on the implementation.

Because rules differ, the same paragraph can produce different word totals across counters. Hyphenated compounds, contractions, decimals, and non-whitespace scripts are common sources of disagreement. A tool might treat "mother-in-law" as one word, two words, or three depending on whether hyphens act as separators. Similarly, "it’s" may remain one unit if internal apostrophes are preserved, or be split into separate tokens if apostrophes break letter runs.

Users should not assume a counter follows a published standard such as UAX #29 unless the tool documents that behavior. Instead, they can derive the tool’s actual rules by feeding it known inputs and observing the outputs. Once the rules are visible, results from different tools can be reconciled by identifying which boundary each tool applies differently.

PixelTidy defines words as Unicode letter or number runs, keeping internal apostrophes together and separating at hyphens. This means contractions stay intact, but hyphenated phrases are divided at each hyphen. Reading time is calculated at a rate of 225 words per minute, rounding up. Continuous CJK text is counted as one run rather than performing language-aware segmentation.

Readers who need a specific standard for academic, legal, or publishing work should verify the tool’s documentation or ask the provider which boundary rules it implements before relying on the count.

Probe String Testing Strategy

Probe strings are short, deliberate inputs used to reveal a counter’s hidden boundaries. Rather than testing only full documents, users can run a small set of controlled cases and compare outputs across tools.

Useful probe categories include:

  • Simple whitespace-separated words to establish a baseline count.
  • Words with internal apostrophes, such as contractions and possessives.
  • Hyphenated compounds to see whether hyphens split words or join them.
  • Decimal numbers and mixed alphanumeric strings to check whether digits count as words and whether decimals break runs.
  • Punctuation-only strings to confirm whether punctuation contributes to word totals.
  • Mixed-script text to observe how the tool handles transitions between Latin and other scripts.

A practical testing table might record the input, the expected behavior under different rules, and the observed output for each tool. If one counter returns six words for "state-of-the-art" while another returns one, the difference is explained by hyphen handling rather than a malfunction.

PixelTidy’s behavior illustrates this approach. Internal apostrophes are kept together, so a contraction counts as one word. Hyphens separate runs, so "state-of-the-art" is counted as four words. Decimals are treated as number runs within the Unicode letter-or-number definition. Continuous CJK text is counted as one run rather than segmented into individual characters or words.

Users should repeat the probe set after any tool update or when switching devices, because counting logic can change without a visible announcement. Keeping a personal record of probe results makes it easier to investigate future discrepancies.

Running a probe test

  1. Select one probe from each category above.
  2. Paste each probe into the word counter and record the displayed count.
  3. Repeat in any alternative tool used for comparison.
  4. Compare results and categorize discrepancies by rule type: apostrophe, hyphen, decimal, punctuation, or script boundary.
  5. Document the behavior for future reference and retest after software updates.

What to verify before relying on a count

If a document contains many contractions, hyphenated terms, or decimal figures, choose a counter whose probe behavior matches the intended publication standard. A counter that splits hyphenated compounds may inflate totals, while one that treats continuous CJK text as a single run may understate length for East Asian languages. Users writing in Chinese, Japanese, or Thai should confirm whether the counter performs language-aware segmentation or applies a generic run-based rule, since the result can differ substantially from manual expectations.

Accuracy-check decision steps

  • Start with baseline whitespace-separated text.
  • Add apostrophe probes to test contraction handling.
  • Add hyphen probes to test compound-word handling.
  • Add decimal and alphanumeric probes to test digit handling.
  • Add punctuation-only and mixed-script probes to test boundary behavior.
  • Record outputs, compare across tools, and retest after updates.

Privacy Verification and Local Execution

Privacy is a separate dimension from accuracy, but it matters when the text being counted contains drafts, client material, or personal information. A browser-based counter can process text entirely in the user’s browser, or it can send the text to a remote server before returning a count. These two models have very different privacy implications.

When text remains local, it does not travel across the network, so there is no server log of the content and no external party receives the document. When text is processed server-side, the input may be stored, logged, or processed by third parties depending on the provider’s policy, which users may not be able to verify.

Users can check network activity in browser developer tools while entering text into a counter. If no request containing the text appears when the count updates, that is consistent with local execution. If a request is sent on every keystroke or when a count button is pressed, the text is likely leaving the device. Absence of observed network activity is not, by itself, a proof of privacy, because some tools may batch uploads or connect at other times.

PixelTidy processes text locally in the browser and never sends tool text to a server. This design means the user’s input stays on their device during counting. Readers using other counters should inspect network behavior or consult the provider’s documentation before pasting sensitive material.

For high-sensitivity documents, the safest choice is a tool that documents local-only processing, or to avoid online counters entirely and use offline software. Users should verify the current behavior before each session, since features and privacy models can change.

How to verify network behavior yourself

Open the browser’s developer tools and select the Network tab before entering text. Type or paste a distinctive phrase into the counter and watch for requests that appear as the count changes. If no request carries the phrase, the behavior is consistent with local processing. Repeat the check after pressing any count or submit button, because some tools defer transmission until an explicit action.

Conditional planning for sensitive text

If the provider does not clearly document local-only processing, treat the input as potentially visible to the provider. For drafts, contracts, or personal records, choose an offline word-counting tool or verify that the online tool states that text never leaves the device. Recheck the behavior before each session, since updates can change how data is handled.