Character Count With and Without Spaces: Examples for Writers
In GlyphFlow, the main character total includes spaces and punctuation. The “no spaces” total removes whitespace, including tabs and line breaks. An emoji can add more than one to either count.
For a submission that specifies “characters including spaces,” check the main total. For “excluding spaces,” check the form’s rules for tabs and line breaks before using a separate counter.
Count a short sentence
Type this sentence into the GlyphFlow character counter:
Write well.
For this exact text, GlyphFlow’s counting rules give 11 characters and 10 without spaces. “Write” contributes five, the space one, “well” four, and the full stop one. Removing the space leaves the letters and punctuation intact.
Copy the sentence without a surrounding blank line, which would change the main total.
Count repeated spaces and line breaks
GlyphFlow uses JavaScript’s \s pattern to remove whitespace for the “no spaces” total. The ECMAScript specification includes whitespace and line terminators in that pattern, so the counter removes tabs and newlines.
| Exact input | Main total | Without whitespace |
|---|---|---|
Write well. | 11 | 10 |
A B with two spaces | 4 | 2 |
A followed by one LF line break, then B | 3 | 2 |
A followed by one tab, then B | 3 | 2 |
For the line-break example, type A, press Enter once, and type B. This example uses one LF newline. A file with a two-character CRLF sequence uses a different representation.
An emoji can occupy several counting units
GlyphFlow uses JavaScript string length for its main total. JavaScript counts UTF-16 code units, according to the ECMAScript string specification. The letters A–Z and a–z use one unit each. Some symbols require two; a sequence can contain several units.
Unicode defines grapheme clusters to approximate the characters you perceive. A cluster can contain several code points, such as a letter followed by a combining accent. The Unicode text-segmentation standard describes the rules; the examples below use default extended grapheme clusters.
| Input | Grapheme clusters | Unicode code points | GlyphFlow main total |
|---|---|---|---|
😀 | 1 | 1 | 2 |
🇨🇦 | 1 | 2 | 4 |
👨👩👧👦 | 1 | 7 | 11 |
Unicode defines flag sequences and joined emoji sequences in its emoji standard. The family sequence includes invisible joiners between its emoji components. Your font and platform determine how you see the sequence. The underlying text retains its components.
Two ways to write é
You can write é as a precomposed letter using one UTF-16 unit, or as an e followed by the combining acute accent U+0301 using two. Both forms occupy one default extended grapheme cluster.
These JavaScript strings specify the two forms:
"\u00E9" // precomposed é: length 1
"e\u0301" // e plus combining acute accent: length 2
GlyphFlow counts each form as supplied, without converting it to the other representation. To compare two counters, give them the same underlying text and check their counting rules.
Check the destination before submitting
- Paste your complete draft into GlyphFlow, including the punctuation and line breaks you intend to keep.
- Read the main total and the “no spaces” figure. Use the rule your destination specifies.
- Check the destination’s editor before submitting a draft with emojis or combining accents.
For a LinkedIn feed post, confirm the finished draft fits in LinkedIn’s editor. Check the platform’s counting rules before assuming they match GlyphFlow’s.