Skip to content

Text Utilities guide

Tool guide. Updated .

How XGM Text Utilities counts words, characters, lines and bytes, converts case and creates URL slugs, and why emoji and accents change the numbers.

What the counter measures

Counts and how they are calculated
CountHow
CharactersUser-perceived characters (grapheme clusters) using the browser's text segmentation
Characters without spacesCode points excluding whitespace
WordsSequences separated by whitespace
SentencesText ending with ., !, ? or , plus a final unterminated sentence
LinesSeparated by line breaks
ParagraphsBlocks separated by blank lines
BytesSize of the text encoded as UTF-8
Reading timeWords divided by 230 words per minute
Why one character can be several unitsA single visible emoji can consist of several Unicode code points, more UTF-16 code units and even more UTF-8 bytes, which is why different systems report different lengths.What you see: 1 characterA family emoji or a flagUnicode code points: severalBase emoji joined with zero-width joiners orregional indicatorsUTF-16 code units: moreWhat JavaScript's string length countsUTF-8 bytes: mostWhat many databases and APIs limit
A single visible emoji can consist of several Unicode code points, more UTF-16 code units and even more UTF-8 bytes, which is why different systems report different lengths.

How to count text

  1. Open the Text Utilities and paste or type your text.
  2. Read the counts; they update as you type.
  3. Compare the relevant number with the limit you need to meet, such as a meta description length or a form field limit.
  4. Edit and watch the numbers change.

Counting happens in your browser, so drafts, messages and documents stay on your device.

Changing case and making slugs

Text Utilities has two more modes. Change case shows the input in every common style at once: camelCase, PascalCase, snake_case, CONSTANT_CASE, kebab-case, Title Case, sentence case, lower and upper case. Words are split at spaces, underscores, hyphens and at the change from lower to upper case, and runs of capitals such as HTTPServer stay together as one word.

Slug turns each line into a URL path segment: accents are transliterated (é becomes e, ß becomes ss), & becomes and, and everything else that is not a letter or digit becomes the separator. You can choose hyphens or underscores and a maximum length, which cuts at a separator rather than in the middle of a word.

Title to slug
How to Fix DMARC p=none in 30 Days
how-to-fix-dmarc-p-none-in-30-days

Emoji, accents and why lengths differ

Text is stored as numbers, and there are several ways to count them. A letter like é can be one code point or two (an e followed by a combining accent), and both look identical. Emoji such as flags and family groups combine several code points into one visible symbol.

The same text measured four ways
TextVisible charactersJavaScript length (UTF-16)UTF-8 bytes
hello555
café445
👍124
🇷🇴 (flag)148

When a form says "maximum 280 characters", the system behind it may count visible characters, code points, UTF-16 units or bytes. If text containing emoji is rejected although the counter shows it within the limit, the service is probably counting something else. The bytes count is useful for database columns and APIs that limit payload size.

Lengths in JavaScript
const text = "🇷🇴 café";
text.length;                                   // UTF-16 code units
[...text].length;                              // code points
[...new Intl.Segmenter().segment(text)].length; // visible characters
new TextEncoder().encode(text).length;          // UTF-8 bytes

Common length limits

Limits you may be writing for
WhereTypical guidance or limitMeasured in
Page title (search results)About 50–60 charactersDisplay width; characters as a guide
Meta descriptionAbout 120–160 charactersDisplay width; characters as a guide
SMS160 characters in the GSM 7-bit alphabet, 70 with Unicode charactersEncoding-dependent units
DNS TXT string255 bytes per stringBytes
Database VARCHAR(n)Depends on the database: characters in some, bytes in othersCheck the documentation

For SEO tags, the meta tag builder warns about lengths directly. For SMS, one emoji switches the whole message to Unicode encoding and cuts the limit per message from 160 to 70 characters, which surprises many senders.

Writing to a limit

Counting is most useful while editing, not after. Paste the draft, note how far it is over the limit, and cut whole phrases rather than individual letters: removing filler words and repeated ideas usually shortens text faster and improves it at the same time. Watch the character count update as you edit.

  • Start with the most important information; limits often truncate from the end.
  • Replace long phrases with short ones: "in order to" becomes "to", "at this point in time" becomes "now".
  • Avoid emoji in SMS and systems with byte limits unless they add real meaning.
  • For translations, leave room: the same message is often longer in German or Romanian than in English.
  • Check line counts for fields displayed in a fixed number of lines, such as notification previews.

For code and data, the byte count is the number to watch. JSON payloads, HTTP headers and DNS records have size limits in bytes, and a string that looks short can exceed them once non-ASCII characters are encoded as UTF-8.

Invisible characters

Text copied from documents, web pages or chat apps can contain characters you cannot see: non-breaking spaces, zero-width spaces, soft hyphens or directional marks. They count as characters and bytes, can break word counts and can cause validation errors in forms and code. A difference between the counter's numbers and what you expect is often the first sign of them.

If a count looks wrong, retype the suspicious part or paste the text into a plain-text editor first. Developers can find such characters with a regular expression like [\u00A0\u200B-\u200F\u2060\uFEFF] in the Regex Tester.

Reading time and word counts

Reading time uses an average of 230 words per minute for silent reading of general text. Technical content, code and text in a second language are read more slowly, so treat the estimate as a lower bound for guides like the ones on https://xgm.ro/guides and a reasonable figure for blog posts and articles.

Word counts split on whitespace. Languages that do not separate words with spaces, such as Chinese or Japanese, are not counted meaningfully this way, and hyphenated words or numbers with spaces count as the tool splits them. For contract or publishing requirements, confirm which counting method the other party uses, for example the one in a specific word processor.

Other text tools work well together with the counter: the case mode changes capitalisation, and the slug mode turns a title into a URL-friendly path such as example.com/blog/my-first-post.

FAQ

Does the counter include spaces?

It shows both: characters including spaces, and characters without whitespace.

Why does an emoji count as one character?

The counter counts characters as people see them. The same emoji may be 2 or more units in JavaScript and 4 or more bytes in UTF-8.

Why is my text too long for a form that allows the same number of characters?

The service may count bytes or UTF-16 code units. Emoji and accented letters use more of those than they appear to.

How is reading time calculated?

Words divided by 230 words per minute, a common average for silent reading.

How are sentences detected?

By sentence-ending punctuation: period, exclamation mark, question mark and ellipsis. Abbreviations with periods can be counted as sentence ends.

Is my text uploaded?

No. All counting happens in your browser.

What counts as a paragraph?

Text separated by at least one blank line.

Why does the byte count matter?

Databases, APIs and protocols often limit size in bytes. UTF-8 uses one byte for ASCII and up to four for other characters.

Why do two word counters give different numbers?

They split words differently: on whitespace only, or also on hyphens, slashes and punctuation. Numbers, URLs and abbreviations are the usual sources of disagreement.

Does a line break count as a character?

A line break is a character in the text, so it appears in the character count with spaces and in the byte count. It is excluded from the count without whitespace.

Does it work for languages without spaces?

Character, line and byte counts work for every language. Word counts rely on spaces, so they are not meaningful for languages like Chinese or Japanese.

Sources