How to count characters with and without whitespace

Use TinyToolbox Character Counter to check a text limit and understand how spaces, line breaks, accents, and emoji affect the result.

Open the tool

The TinyToolbox Character Counter reports two totals for the same text: all characters and characters after removing whitespace. For example, Pack 2 bags. has 12 characters in total and 10 without whitespace. The two spaces explain the difference. The digit and the period are included in both totals.

Use the full count when a form says that spaces count. Use the second number when the instructions explicitly exclude whitespace. If an application has its own validation, compare the exact text you intend to submit in that application as well. The same visible phrase can have different lengths under different definitions of a character.

Paste the exact text and run the counter

  1. Open the Character Counter.
  2. Paste your draft into Input text.
  3. Select Run tool.
  4. Read Characters and Without whitespace in the result.
  5. Make any revisions to the draft and run the counter again before copying the final text to its destination.

Start with a small check. Enter North depot. The five letters in “North,” one space, and five letters in “depot” add up to 11 characters. The count without whitespace is 10. Add a period at the end and run it again. Both totals increase by one because the period survives the whitespace removal.

The tool counts what reaches its input. When checking a draft from a spreadsheet or a rich-text editor, paste the text that will go into the destination field. Rich styling such as bold and italics is separate from the characters in a plain-text paste. If you paste literal Markdown markers such as two asterisks around a word, those visible markers are part of the input and count.

Know what the two totals include

The full total counts Unicode code points in the submitted string. The second calculation removes whitespace using JavaScript’s whitespace matching and counts the remaining code points. That includes ordinary spaces, tabs, and line breaks among the characters it removes. The result label Without whitespace covers more than spaces between words.

Plain-text sample Characters Without whitespace
A B 3 2
A B with two spaces 4 2
A-B 3 3
A, B. 5 4
Room 17B 8 7

Subtract the second result from the first to find how many whitespace code points occurred in the submitted text. That difference includes any leading or trailing spaces that survived the paste, as well as the spaces between words. It does not say where those characters occurred. A list with several spaces between two words can give the same difference as a list with one space between each of several words.

The second result includes numbers and punctuation. For instance, 2026-04 counts as seven characters in both totals. If an instruction asks for alphabetic letters only, these two counts answer different questions. Clarify which characters the instruction includes before relying on a figure near the limit.

Check line breaks and pasted spacing

For a short test, type Pack, press Enter once, and type bags on the next line. There are eight letters, plus the newline in the text field. The total without whitespace is eight. Visually wrapping Pack bags to two lines because the input box is narrow does not introduce a newline. Pressing Enter or pasting a line break adds one to the text itself.

A blank line between paragraphs adds line-break characters even though it contains no visible letters. Likewise, a tab pasted from a table is whitespace. If a draft looks shorter than the full count suggests, check for a tab after the last value, spaces at the ends of copied lines, or blank lines at the start or end of the paste. Those can enter the field without being obvious in a compact preview.

Line-ending conventions matter when you compare results between systems. A newline can be represented by a single line-feed character or by a carriage return followed by a line feed. A browser text area may normalize pasted line endings. If a file-based tool is counting both characters in a pair and the browser field uses one, a line-count difference can appear in the full total. Compare the final input in the intended field for a limit that is sensitive to line endings.

Understand why a visible symbol can count more than once

The converter uses code points. A screen can display several code points as a single visible unit. A thumbs-up emoji such as 👍 is one code point, while 👍🏽 uses the thumbs-up and a separate skin-tone modifier. The modified emoji appears as one symbol but contributes two to both totals.

A similar distinction applies to accents. Many keyboards enter é as one precomposed character. An editor can also represent it as e followed by a combining acute accent. The two representations can look alike. In the first version, the count is one. In the second, it is two. If you copy a name from one system to another, retain the correct spelling and compare how the receiving field counts the pasted text.

Code points are also separate from bytes. For example, é in its precomposed form counts as one here and takes two bytes in UTF-8. A storage system may impose a byte limit even when a form describes its field as text. Check the actual requirement rather than using the character result as a byte count. Some apps may instead use UTF-16 code units or user-perceived symbols. An emoji near a limit is a useful test when you need to find out which count an app uses.

Trim a draft without losing necessary information

Suppose a field is limited to 24 characters, including spaces. Start with North depot pickup desk. and count it. It contains 24 characters. If you add another space or replace the period with two punctuation marks, count the actual revised string again. Save the draft in a separate place before making cuts so you can review what any proposed edit removes.

When a draft is over its limit, first look for unnecessary spacing, repeated information already supplied in a nearby field, and words the reader can understand from context. Keep the facts the field needs. For example, shortening the label to North depot pickup leaves 18 characters and retains the location and activity. If the reader needs to distinguish a desk from a loading bay, keep that detail and find room elsewhere.

For a form with several text limits, check each field separately. A section heading and its description can have independent limits. Counting both after pasting them as one passage gives a total that may include a separating newline and cannot establish that either field passes individually. Record the final labels beside their respective limits so the checked value gets pasted into the right place.

Compare a destination that reports a different count

Start with an ASCII control such as A B.. The full count is four and the count without whitespace is three. Paste it into the destination and compare. If the difference appears only when you add line breaks, examine line-ending or trimming behavior. If it appears only when you add emoji or accented text, check the definition of character used by the destination.

Also check whether the app counts added material. A title field can include a prefix, a generated suffix, or an auto-inserted space. A form might trim a draft before saving it. If the destination shows a preview or stored version, reopen it after saving and check whether it matches the submitted text. Comparing the same string is necessary before interpreting a difference in the counters.

If the limit is precise and unfamiliar, leave enough room for the destination’s count when you can shorten the wording without losing meaning. For a required name or exact quotation, preserve the source and ask the receiving app to validate the final entry. The counter can show what is in the pasted text, while the destination decides what it accepts.

Keep a record tied to the final text

For a handoff, keep the exact draft and specify which result you used. A short note such as “North depot pickup, 18 characters including spaces, against a 24-character field” identifies both the wording and the rule. Keep the counted version with the note so a later edit does not retain the old count by mistake.

When revising several titles or labels, check the version you are about to paste, including its periods, spaces, and line breaks. Compare that figure with the field’s limit and reopen the final entry when practical. That confirms both the length and the exact text a reader will see.

Compare two drafts using both totals

Imagine a compact reference card has room for a 30-character heading. The draft Pickup desk at North depot contains 26 characters, including four spaces. Its count without whitespace is 22. If the reviewer suggests Pickup desk / at North depot, the slash adds one non-whitespace character and the new space adds another character overall. The revised counts are 28 and 23. The two versions fit the limit, and the space-free figure helps explain how much of the change came from punctuation.

Run each complete draft separately. Comparing an old copy from the result field with a newer draft in the editor can make a revised count look unexpected. Keep both candidate strings in your worksheet and label the one you select. If you replace a conventional space with a nonbreaking space for layout, the visible text can look unchanged. The full counter still includes the character and the whitespace-free count removes it. The layout app may treat the line break behavior differently even though the totals stay the same.

For a multiline reference, also check what happens when the destination inserts its own separators. Two headings copied into separate fields can pass independent limits while a combined label uses an additional space, slash, or line break. Build the exact combined label and count it when the combined form has its own limit. Reuse the individual results only for the individual fields.

Finish by opening the saved or submitted version where possible. Check that the punctuation and spacing you counted remained in place. If the destination changes a quote mark, strips a line break, or trims the ends, use the stored wording for any later comparison. This keeps the count attached to the version readers actually see.