Skip to content

Character & Word Counter

Real-time character, word, sentence, paragraph, line, and byte counts plus reading-time estimate.

INPUT
0
Characters
0
Chars (no spaces)
0
Words
0
Sentences
0
Paragraphs
0
Lines
0
Bytes
0
Reading time (min)

Testing an input length limit

A field documented as accepting 255 characters needs four values, not one: 254, 255, 256 and something far beyond the limit. Paste a candidate string above to confirm its exact length before you send it, because a string assembled by hand is almost never the length you assumed.

The result you care about is what the server does, not what the form does. A maxlength attribute stops typing in the browser and stops nothing else. Send the over-long value straight to the API and check three things: whether it is rejected with a clear error, whether it is silently truncated, and whether truncation corrupts the data. Silent truncation is the worst outcome because nothing reports a failure while the stored value is wrong.

Characters, code points and bytes are three different numbers

This is where most length-limit bugs live. A user counts what they see. JavaScript counts UTF-16 code units. A database column counts bytes. For plain English these agree, and for everything else they do not:

TextLooks likeCode pointsUTF-16 unitsUTF-8 bytes
café4 characters445
日本語3 characters339
👍1 character124
🇺🇦 flag1 character248
👨‍👩‍👧‍👦 family1 character71125

The family emoji is the value to keep in your test data. It is one thing on screen and eleven units to JavaScript, so a field that permits 10 characters may reject a single emoji, and a truncation at 10 units cuts the sequence in half and produces a broken glyph or a replacement character. The accented é has a second trap: it can be one code point or two, depending on whether the text was normalised, so the same visible word can have two different lengths.

Checking copy against a platform limit

Length limits outside the product matter too, and they are cheap to check before publishing rather than after. A page title is generally rendered up to roughly 60 characters in search results and a meta description to roughly 155, both measured in pixels in practice rather than characters, so treat those as guidance and not a hard rule. A single SMS segment is 160 characters in the basic alphabet and drops to 70 as soon as one character falls outside it: meaning one emoji in a message can more than double what it costs to send.

Word and line counts in QA work

Line counts answer practical questions quickly: how many rows a CSV export produced, whether a log file grew between two runs, how many cases are in a pasted list. Word counts matter for content-driven products where an editor is told a summary must fit a range.

Be aware that word counting is defined by whatever separator rule the counter uses, so two tools can legitimately disagree on hyphenated words, on text with no spaces between words as in Japanese, and on strings of punctuation. When a limit is contractual, confirm which definition the other side applies before arguing about a number.

A reusable set of length test values

Counting runs in your browser, so pasting real content from an unreleased page or a customer record does not send it anywhere.

Frequently asked questions

Why does my emoji count as more than one character?

Because most systems count code units rather than what a reader perceives as a character. A thumbs-up is two UTF-16 units, a flag is four, and a family emoji built from four people joined by zero-width joiners is eleven. Any of these can exceed a short field limit on its own.

What is the difference between characters and bytes?

A character is what a person sees; a byte is storage. In UTF-8, Latin letters take one byte, accented and Greek or Cyrillic letters take two, most CJK characters take three and emoji take four or more. A database column declared as 255 bytes holds far fewer than 255 characters of Japanese.

Does maxlength in HTML make a field secure?

No. It is a convenience for typing and is trivially bypassed by editing the page, by pasting in some browsers, or by calling the API directly. Server-side validation is the only real limit, and testing it directly is the only way to know it exists.

How many characters should a page title be?

Search results truncate by pixel width rather than character count, but roughly 60 characters is the usual working guide for a title and roughly 155 for a meta description. Treat those as targets to check against, not as a specification.

Do spaces and line breaks count toward a limit?

Usually yes, and that is worth testing explicitly because implementations differ. A newline may be one character or two depending on line endings, which means the same text can pass validation on one platform and fail on another.

Why do two tools report different word counts?

Because word counting depends on the separator rule in use. Hyphenated words, punctuation runs and scripts written without spaces are all handled differently. When a limit is contractual, agree on the definition before comparing numbers.