Character counter

5 of 2 ratings
Character counter

Character counter is a free tool that counts the characters, words and lines in any text.

How do I use the character counter?

Paste or type your text into the input, run the count, then read the three result fields.

  1. Enter the exact text you intend to use, including spaces and line breaks.
  2. Run the counter again after any final edits so the displayed results are refreshed.
  3. Check Characters, Words and Lines against the requirements of the destination field.
The Character counter tool on digily.link, showing its input form

Count the final version rather than an earlier draft. Removing a sentence can also remove a line break or leave a double space, so all three totals may change.

What does the character count include?

The Characters result uses PHP's mb_strlen function to measure the length of the supplied text. Spaces, punctuation marks, numbers and line-break characters contribute to text length, as do letters.

This is a character-length measurement rather than a byte count. Under the tool's configured multibyte encoding, mb_strlen counts decoded characters rather than user-perceived characters, which are usually represented by extended grapheme clusters. For Unicode text, a grapheme cluster may contain several Unicode code points. An emoji made from several joined code points, a flag or a letter with a combining accent may contribute more than one to the total. The tool does not apply the special counting rules used by individual social networks or messaging services.

The Words result uses PHP's str_word_count function. Hyphenated terms and apostrophes can affect how a word is recognised, while numbers alone are not treated in the same way as ordinary alphabetic words. Accented text and scripts such as Arabic, Chinese or Hindi may also produce a total that differs from a word processor because str_word_count does not provide full Unicode word segmentation.

The Lines result is one plus the number of line-feed characters in the text. Empty text therefore reports one line; a trailing line feed adds an empty final line; LF and CRLF newline sequences each add one line, while a lone carriage return does not. This is useful for pasted lists, addresses, poetry, subtitles and data copied from a spreadsheet column.

Where does counting characters save time?

It helps when spaces, punctuation and line breaks count towards a field or platform limit. Common examples include:

  • Checking a post before placing it in the X composer, while remembering that X may apply its own weighting to links and some characters.
  • Preparing LinkedIn profile fields, advert copy or form responses that have stated length limits.
  • Reviewing page titles and meta descriptions before entering them in WordPress, Shopify or another content management system.
  • Checking names, address lines and personalised sentences before a mail merge from Microsoft Excel.
  • Counting rows in a plain-text list exported from Google Sheets, using the line total as a quick check.
  • Drafting SMS text, where the final number of message parts depends on character encoding as well as length.

When working to a hard platform limit, leave a small margin instead of aiming for the final character. Added mentions, tracking parameters, smart punctuation or pasted line breaks can change what the receiving platform accepts.

Example result produced by the Character counter tool

Worked examples and awkward input

For the input Hello, Sam!, the character total is 11 because the comma, space and exclamation mark are included. The word total is 2.

For Room 12, the character total is 7, including the space. Do not assume the word total will treat 12 as an ordinary word, because str_word_count is designed primarily around alphabetic words.

An empty string contains no characters or words. With very long material, paste only the exact field value because spaces and line breaks outside it would increase the character total.

For non-Latin text, emoji-heavy copy or text containing combined Unicode symbols, use the result as a general length check and confirm the final value in the destination platform. There is no universal definition of a user-visible character across all systems. If capitalisation also needs correcting before publication, the Case converter may help as a separate step.

Frequently asked questions

Does one emoji always count as one character?

No. A simple emoji may be represented by one code point, while family emoji, skin-tone variants and flags can contain several code points joined together. They may look like one symbol on screen but contribute more than one to a programmatic length count.

Why does the word total differ from Microsoft Word or Google Docs?

Different applications use different rules for apostrophes, hyphens, numbers and multilingual text. Microsoft Word and Google Docs use their own counting rules, whereas this tool uses PHP's str_word_count function. For a formal submission with a specified counting method, use the application named in the instructions.

Is my text processed in the browser?

No. The input travels to the server over HTTPS, where the count is performed, and it is not stored.

Can this tell me how many SMS messages will be sent?

No. SMS segmentation depends on whether the message can use the GSM 7-bit default alphabet (GSM-7) or must use UCS-2. Characters from the GSM-7 extension table consume two septets, and concatenated messages have different per-part allowances. Use a dedicated SMS segment calculator or the preview supplied by your messaging provider before sending a campaign.

Can I use the line count to validate a CSV file?

The line total can provide a quick sense check, but it does not parse CSV rules. Quoted fields may legally contain line breaks, so one record does not always equal one physical line. Open the file in a spreadsheet or CSV-aware editor before relying on the count for an import.

Popular Tools