In almost every form, text box and character limit, a character is any single letter, digit, space, punctuation mark or symbol, and each line break counts as well. Hello, world! is 13 characters: ten letters, a comma, a space and an exclamation mark. The exceptions are emoji, accented letters and some non-Latin scripts, where two systems can report different numbers for the same text because Unicode offers more than one way to measure it.
The short list of what counts
| What you typed | Counts as | Notes |
|---|---|---|
| A letter, upper or lower case | 1 | A and a are different characters, but each is one. |
| A digit | 1 | 2026 is four characters. |
| A space | 1 | Counted unless the limit says "without spaces". |
| A punctuation mark or symbol | 1 | Commas, periods, quotation marks, #, @, % and so on. |
| A tab | 1 | One character, however wide it looks. |
| A line break (pressing Enter) | Usually 1 | Some systems store it as two characters. |
| An emoji | 1 to the eye | Often 2 or more to the software behind a form. |
Nothing in this list depends on whether the character is visible. A space at the end of a line and a blank line between paragraphs take up room in a limit just as letters do.
A worked example
Take this two-line note:
Dear Ms. Okafor,
Order #4521 ships on 3 May.
It is 44 characters long.
| Kind | Count | Which ones |
|---|---|---|
| Letters | 27 | |
| Digits | 5 | 4, 5, 2, 1 and 3 |
| Punctuation and symbols | 4 | Two periods, a comma and # |
| Spaces | 7 | Two on the first line, five on the second |
| Line break | 1 | The Enter after the comma |
| Total | 44 |
The first line is 16 characters and the second is 27. That adds up to 43, and the line break between them makes 44. Forgetting the line break is the easiest way to be one short when counting by hand.
Leave out the seven spaces and the line break and 36 characters remain. That is the figure a "characters without spaces" count reports; the guide to counting with and without spaces covers when that number is the one being asked for.
Why "a character" is ambiguous
Computers store text as numbers, and Unicode is the standard that says which number stands for which character. The difficulty is that one thing a reader sees as a single character can be built from several of those numbers, and each number can take up several units of storage. The Unicode glossary lists four separate meanings under the word "character", and the Unicode FAQ on combining marks describes four ways to count the characters in a string.
Unicode's text segmentation standard puts the problem this way: a single code point is "often, but not always the same as" what a typical user might think of as a character. It uses the term user-perceived character for what a reader would count, and grapheme cluster for the closest thing software can compute.
That gives four measures, all in real use:
- Visible characters (grapheme clusters): what a person would count on the screen.
- Code points: the individual Unicode numbers that make up the text.
- UTF-16 code units: what JavaScript's
lengthreports and what an HTML form'smaxlengthattribute counts. - UTF-8 bytes: the size of the text when it is saved or sent as UTF-8.
| Text | Visible characters | Code points | UTF-16 units | UTF-8 bytes |
|---|---|---|---|---|
Hello, world! |
13 | 13 | 13 | 13 |
| café, with é stored as one code point | 4 | 4 | 4 | 5 |
| café, with é stored as e plus a combining accent | 4 | 5 | 5 | 6 |
| 🙂 | 1 | 1 | 2 | 4 |
| 👍🏽 | 1 | 2 | 4 | 8 |
| 👨👩👧👦 | 1 | 7 | 11 | 25 |
| 🇵🇰 | 1 | 2 | 4 | 8 |
For plain English text all four numbers are the same, which is why the question rarely comes up until an accent or an emoji is involved. Then they separate:
- é can be stored as a single code point or as a plain
efollowed by a combining accent. The two look identical on screen. - 🙂 is one code point, but it sits outside the range that fits in one UTF-16 unit, so it takes two.
- 👍🏽 is a thumbs-up followed by a skin tone modifier: two code points drawn as one picture.
- 👨👩👧👦 is four people joined by three invisible joiner characters, seven code points in all.
- 🇵🇰 is a pair of regional indicator letters, P and K, that fonts draw as a flag.
The guide to code points and grapheme clusters explains the mechanics, and the guide on why emoji produce different counts goes through more examples.
Where the usual rule changes
Some limits use a counting rule of their own. The common ones:
- "Without spaces" limits. Spaces are left out, and sometimes tabs and line breaks too.
- Line breaks. A line break is one character in most counters, but some systems store it as a pair of characters, a carriage return and a line feed. See how line breaks, tabs and spaces affect the count.
- X. Posts are measured with a published weighting. Every emoji counts as two however complex it is, Chinese, Japanese and Korean characters count as two each, and every link counts as the same fixed length whatever its real length.
- SMS. A text message is measured in encoded units, not characters. A few symbols such as
[and€take two units, and a single emoji changes the encoding of the whole message. The SMS Character Counter shows this for your own text. - Byte limits. Databases and some programming interfaces limit the stored size. In UTF-8, é is two bytes and most emoji are four.
- Invisible characters. Non-breaking spaces and zero-width characters still count, although you cannot see them.
What does not count
- Formatting. Bold, italics, font, size, color and alignment are not characters. The exception is formatting written as text: if you type Markdown or HTML into a box and the limit applies to what you typed, the asterisks and tags are characters like any others.
- Wrapped lines. A long paragraph that wraps onto three lines on your screen contains no line breaks. Only a line break you typed is a character.
Which count to trust
The count that matters is the one made by whatever enforces the limit.
- A web form with its own counter. That counter is the authority. Draft elsewhere, then confirm in the form.
- A written brief such as "maximum 500 characters". Count everything, including spaces and line breaks, unless it says otherwise. If you are within a few characters of the limit, say which count you used.
- A platform. Use its published rule where there is one; the platform limits reference lists what each one documents.
- A database column or an API field. Ask which unit the limit is in: characters, UTF-16 code units or bytes.
The Character Counter on this site reports visible characters as its main figure. Its Advanced statistics panel shows Unicode code points, UTF-16 code units and UTF-8 bytes next to it, so you can see at once whether your text is one where the four measures disagree. The methodology page describes each count in detail.