# Counting characters in a text

In the Messaging API, characters in a text are counted in UTF-16 code units (16-bit). Characters expressed in multiple code units, such as some kanji characters and Unicode emojis, are counted as multiple characters instead of one character.

For example, a Unicode emoji 🍎 is expressed in two code units. Therefore, it's counted as two characters, not one.

The number of characters in a text including LINE emojis is counted with the placeholder for the each emoji ($) in the text replaced by the alternative text (text for devices that can't display LINE emojis) of the LINE emoji to be used. Therefore, when sending a text message including LINE emojis, the number of characters in a text may unintentionally exceed the maximum number of characters and sending the message may fail. Note that the alternative text for each LINE emoji isn't disclosed.

However, the following properties are counted in grapheme cluster (opens new window) units, not in UTF-16 code units:

Type Property
All action objects
  • label
Postback action objects
  • displayText
  • fillInText
  • label
  • text
Message action objects
  • label
  • text
Buttons template messages
  • text
  • title
Confirm template messages
  • text
Carousel template messages
  • text
  • title
Rich menu objects
  • chatBarText
  • name