Character Counter

Type or paste text to count its characters with and without spaces, its lines and its size in UTF-8 bytes. Set a limit to see how many characters you have left.

Updated How it works

Bytes (UTF-8)

0 bytes

characters
With spaces
0 characters
Without spaces
0 characters
Lines
0 lines

Enter text and the counts appear right away

How to use

  1. Type or paste your text into the Text box.
  2. The counts update as you type. There is no button to press. You see With spaces, Without spaces, Lines and the size in Bytes (UTF-8).
  3. If your text has a length limit, enter it under Character limit. The tool compares it with the count with spaces and tells you “12 characters left” or “5 characters over”.
  4. Press Copy to copy the counts as one line, for example “Characters with spaces: 293 / without spaces: 240 / lines: 2”.
  5. Press Clear to empty the box. If you cleared it by mistake, press Undo in the message that appears.

Use it to check that an answer on an application form, a product description or a social media post fits its limit before you submit it. Developers can use the byte count to check whether a string fits a database column, an API field or a message size limit that is measured in bytes rather than characters.

With spaces counts everything, including spaces and line breaks. Without spaces counts only the visible characters. The count with spaces is always greater than or equal to the count without spaces. So if you do not know which rule a form uses, keep the count with spaces under the limit and you meet both rules.

How it counts

  • One character is one character as you see it on screen. A letter, a digit and a punctuation mark each count as 1.
  • Emoji count as 1. This includes emoji built from several code points that show up as one symbol, such as 👍🏽 (thumbs up with a skin tone) or 👨‍👩‍👧 (a family).
  • Accented letters count as 1, whether the accent is part of the letter (é) or a separate combining mark added after it (e + ´).
  • Spaces are the space, the tab and the line break. A non-breaking space and a full-width space also count as spaces.
  • With spaces counts each line break as 1.
  • Without spaces leaves out all spaces, tabs and line breaks.
  • Lines is the number of line breaks plus 1, so an empty line counts as a line.
  • Bytes is the size of the text in UTF-8, the encoding used by most of the web. Plain English letters, digits, spaces and line breaks are 1 byte each. Accented letters such as é or ü are 2 bytes. Chinese, Japanese and Korean characters are 3 bytes. Most emoji are 4 bytes, and an emoji built from several code points is more.
  • Character limit accepts a whole number from 1 to 100,000 and is compared with the count with spaces.

Splitting text into characters as you see them follows the Unicode rules for text segmentation (Unicode Standard Annex #29). Byte lengths follow the UTF-8 definition in RFC 3629: code points up to U+007F take 1 byte, up to U+07FF take 2 bytes, up to U+FFFF take 3 bytes, and code points from U+10000, where most emoji live, take 4 bytes.

Examples

Every number below was produced by entering the text into this tool.

TextWith spacesWithout spacesLinesBytes (UTF-8)
Hello world1110111
a, line break, b3223
café4415
Hi, 世界!76111
👍🏽1118
👨‍👩‍👧11118
  • café has 4 characters but 5 bytes, because é takes 2 bytes in UTF-8.
  • Hi, 世界! has 7 characters. The two Chinese characters take 3 bytes each, so the text is 11 bytes.
  • The family emoji is three people joined by invisible joiners. It shows up as one symbol, so it counts as 1 character, but it takes 18 bytes.

Fitting an application answer into 300 characters

Enter 300 under Character limit and paste this answer (two paragraphs with one line break between them):

I break big problems into small steps and check each one.

When I ran the budget for our student club, the receipts and the ledger did not match for one month. I went back through three months of transactions, day by day, and found that one receipt had been entered twice. After that, I set up a rule to reconcile the ledger on the last day of every month.

The result is 355 characters with spaces, 287 without spaces and 2 lines, and the tool says “55 characters over”. If you copy the two paragraphs from this page, your browser may add an empty line between them. Delete it so there is only one line break, or you get 356 characters and 3 lines.

After shortening the second paragraph to

When I ran our student club budget, the receipts and the ledger did not match for one month. I went through three months of transactions and found one receipt entered twice. Since then, I reconcile the ledger at the end of every month.

the answer is 293 characters with spaces and 240 without spaces, and the tool says “7 characters left”. Notice that the first version would have passed a 300-character limit that does not count spaces.

Checking a field that is limited in bytes

Say an API accepts a shop name of at most 40 bytes. Cafe Muller - Tokyo branch is 26 characters and 26 bytes, well under the limit. Write it with accents, a Japanese name and an emoji instead, Café Müller – Tokyo branch 東京店 🍰, and it is 32 characters but 45 bytes, so it no longer fits. é and ü take 2 bytes each, the en dash (–) and each of the three Japanese characters take 3, and the cake emoji takes 4. A character count alone would not tell you that.

Edge cases

  • Empty box: every count is 0.
  • Line breaks counted as 2: this tool counts a line break as 1 character. Some sites count it as 2, because Windows stores a line break as two characters (CR LF). If your text has many lines, the site’s count can be higher by the number of line breaks. Always check the final count shown by the form you submit to.
  • Double spaces: two spaces in a row count as 2 characters. Text pasted from a PDF or a word processor often has double spaces or a space at the end of a line, which makes the count with spaces higher than you expect.
  • Empty lines are line breaks: leaving an empty line between paragraphs adds two line breaks. First paragraph. and Second paragraph. with an empty line between them is 35 characters with spaces, 31 without spaces and 3 lines.
  • Other sites may count emoji differently: many systems count a JavaScript string length or code points instead of what you see. There, 👍🏽 counts as 2 or 4, not 1. Some social networks also give URLs or certain characters a fixed weight. Treat this tool’s count as the human count, and check the final number on the site.
  • Long texts: text is counted as soon as you paste it. A whole book chapter does not freeze the page.
  • Words and sentences: this tool does not count words or sentences.

Frequently asked questions

Should I look at the count with spaces or without spaces?

Follow the instructions of the place you submit to. If they do not say, make both counts fit. Because the count with spaces is never smaller than the count without spaces, fitting the count with spaces is enough.

Is my text saved or sent anywhere?

No. Counting happens in your browser. Your text is not sent to a server and is not saved in your browser either, so nothing is left after you close the page, even on a shared computer.

How many characters is an emoji?

One, if it shows up as one symbol. Other sites may count the same emoji as 2 or more, so check their count before you submit.

Why is the byte count bigger than the character count?

UTF-8 uses 1 byte for plain English letters and digits, but 2 to 4 bytes for accented letters, other alphabets, Chinese, Japanese and Korean characters, and emoji. Text in plain English has as many bytes as characters. Any other character makes the byte count grow faster.

When do I need bytes instead of characters?

When a limit is about storage or transfer size rather than what people read. Examples are a database column defined in bytes, a length limit in an API or file format, or a payload limit for a push notification. If the limit is about what a reader sees, use characters.

What does the character limit compare against?

The count with spaces. If your limit does not count spaces, read the count without spaces in the result and compare it yourself.

How it works

One character is one character as you see it on screen. Letters, digits, punctuation, emoji and emoji with a skin tone each count as 1. With spaces counts spaces, tabs and line breaks, and a line break counts as 1. Without spaces leaves out spaces, tabs and line breaks. Lines is the number of line breaks plus 1. Bytes is the length of the text encoded as UTF-8. Your text never leaves your browser.

Last checked

Found a calculation mistake? Let us know.