Format messages

  • Google Chat apps can format text messages using Markdown syntax for bold, italic, strikethrough, monospace, and bulleted lists.

  • Chat apps can format text within cards using a subset of HTML tags for bold, italics, underline, strikethrough, font color, hyperlinks, and newlines.

  • You can @mention specific users or all users in a space within text messages using<users/{user}> or<users/all> respectively.

  • Google Chat apps can use built-in icons, Google Material icons, or custom icons within cards to add visuals alongside text.

This page explains how Google Chat apps can format text to send messages thatcontain any of the following:

  • Rich text that contains hyperlinks or @mentions one or all users in aChat space.
  • Text that appears in a card interface, including as paragraph text orUI text that displays alongside an icon, such as a button.

Format a text message

Chat lets you add basic formatting to a text message, includingbold, italic, and strikethrough, by using a small subset of Markdown syntax. Youformat text differently in text messages than in card messages because textmessages are formatted with the same syntax that Chatusers use.

To format text messages, use the following syntax:

FormatSymbolExample syntaxText displayed in Google Chat
Bold**hello*hello
Italic_ (underscore)_hello_hello
Strikethrough~~hello~hello
Monospace` (backquote)`hello`hello
Monospace block` ` ` (three backquotes)```
Hello
World
```
Hello
World
Bulleted list* or - (hyphen) followed by a space

* This is the first item in the list

* This is the second item in the list

  • This is the first item in the list
  • This is the second item in the list
Hyperlink<hyperlink|display text><https://example.com|Example website>

Example website

To learn more about hyperlinking, seeFormat links.

Mention user<users/{user}> where{user} is the user ID.<users/123456789012345678901>

@Mahan S

To learn more about mentioning users, seeMention users in a text message.

For example, consider the following JSON:

{"text":"Your pizza delivery *has arrived*!\nThank you for using _Cymbal Pizza!_"}

This formatted text message displays the following in a Chatspace:

Cymbal Pizza app sends a text message that the delivery has arrived.

View text formatting sent in a message

When a user sends a message, the plain-text body of the message is in thetext field. Some formatting that is applied to the text message using Markdownsyntax, is in thetext field. Additional formatting is in theoutput-onlyformattedText field, including the following:

  • Additional Markdown syntax for text
  • User mentions
  • Custom hyperlinks
  • Custom emoji

For example, consider the following text sent by a user:

Message received in Chat with the word

If the message was formatted by using theFormat menu in theChat UI, thetext field contains the text only, while theformattedText field contains the markups, the text, and the hyperlink. Thefollowing example shows the draft of a text message with a word hyperlinked,items in a list, and one word bolded:

Message draft with the word

The message is received in the following format:

{"text":"I can meet there at:\nNoon\n3 pm\n5 pm\nWhat time works for you?","formattedText":"I can meet <http://example.com|there> at:\n* Noon\n* 3 pm\n* 5 pm\nWhat time works for *you*?",}

Format links

If you include a plain link URL in your message text, such ashttp://www.example.com/, Google Chat uses this as the link text andautomatically hyperlinks that text to the specified URL.

To provide alternate link text for your link, use the following syntax:

Example syntaxText displayed in Google Chat
<https://example.com|Example website>

The pipe and link text are optional, so that<https://www.example.com/> andhttps://www.example.com/ are equivalent.

Use custom emoji in a text message

Chat apps cansend text messageswith custom emoji to personalize messages. Custom emojis are only available forGoogle Workspace organizations, and the administrator must turn custom emojis onfor the organization. For more information, seeLearn about custom emojis in Google ChatandManage custom emoji permissions.

To create messages with custom emojis, your app must useuser authentication.Custom emojis aren't supported inmessages created as a webhookor inmessages created with app authentication.

To add custom emoji to the text of a message, specify thename oremoji_name of thecustomEmoji resource:

{"text":"Hello <customEmojis/CUSTOM_EMOJI_ID>."}

To use this sample, replaceCUSTOM_EMOJI_ID with the IDfor the custom emoji. You can find this ID in thenameoremoji_namefield of thecustomEmoji resource.

Mention users in a text message

Chat apps cansend text messagesthat @mention one or all users in a Chat space.To mention users that haven't joined the space or aspace that is in import mode,Chat apps must send the message withuser authentication.

@mention specific users

To @mention a specific user, add<users/{user}> to the text message where{user} is the ID of the user. For example, consider the following textmessage where123456789012345678901 represents the ID for the user Mahan S.:

{"text":"A customer has reported an issue. Assigning ticket #942 to <users/123456789012345678901>."}

The text message displays as the following:

Chat app mentions a person in a text message.

You can specify theusers/{user} value in the following ways:

  • If your Google Chat app is responding to a message sent by theuser, you can use themessage.sender.name field of theMESSAGE interaction event.
  • If your Google Chat app is creating anasynchronous text message,you can specify the value forusers/{user} in the following ways:

    • Use thename field of the Google ChatUser resource, such asusers/123456789012345678901.
    • Use the user's email address as an alias for the{user} value. Forexample, if the email address ismahan@example.com, you can specifythe user asusers/mahan@example.com. To use an email alias, yourGoogle Chat app mustauthenticate as a user.
  • If you use the People API, you can also use thepeople.get methodto identify the user ID.

@mention all users

To create a text message that @mentions everyone in a space, replace{user}withall. The following JSON example mentions all users in a message:

{"text":"Important message for <users/all>: Code freeze starts at midnight tonight!"}

Format text that appears in cards

Inside cards, most text fields support basic text formatting by using a smallsubset of HTML tags. You format text differently in card messages than in textmessages because text messages are formatted with the same syntax thatChat users use.


Use the Card Builder to design and preview messaging and user interfaces for Chat apps:

Open the Card Builder

Format paragraph text

The supported tags and their purpose are shown in the followingtable:

FormatExampleRendered result
Bold"This is <b>bold</b>."This isbold.
Italics"This is <i>italics</i>."This isitalics.
Underline"This is <u>underline</u>."This isunderline.
Strikethrough"This is <s>strikethrough</s>."This isstrikethrough.
Font color"This is <font color=\"#FF0000\">red font</font>."This is .
Hyperlink"This is a <a href=\"https://www.google.com\">hyperlink</a>."This is ahyperlink.
Time"This is a time format: <time>2023-02-16 15:00</time>."This is a time format:.
Newline"This is the first line. <br> This is a new line."This is the first line.
This is a new line.

To define lists and code blocks, use the following tags:

FormatExampleRendered result
New line"Line 1<br>Line 2"Line 1
Line 2
Monospace"This is an <code>inline code</code>."This is aninline code.
Monospace block"<pre><code>This a code block.</code></pre>"
This is a code block.
Bulleted list"<ul><li>List item 1</li><li>List item 2</li></ul>"
  • List item 1
  • List item 2
Ordered list"<ol><li>List item 1</li><li>List item 2</li></ol>"
  1. List item 1
  2. List item 2

Markdown

WhenMarkdown syntax is turned on, you can use the following syntax:

FormatExampleRendered result
Bold**hello** or __hello__hello
Italic*hello* or _hello_hello
Strikethrough~hello~hello
Monospace`hello`hello
Monospace block```
Hello
World
```
Hello
World
Bulleted list

- This is the first item in the list

- This is the second item in the list

  • This is the first item in the list
  • This is the second item in the list

* This is the first item in the list

* This is the second item in the list

  • This is the first item in the list
  • This is the second item in the list
Ordered list

1. This is the first item in the list

2. This is the second item in the list

  1. This is the first item in the list
  2. This is the second item in the list
Hyperlink[Example website](https://example.com)Example website

Add icons to text

To display icons alongside text in a card, you can use theDecoratedTextandButtonListwidgets.

The following sections explain how to use built-in icons, Google Materialicons, or custom icons in decorated text or buttons.

Use icons from Chat

To use a built-in icons available in Chat,specify one of the following:

The following table lists the built-in icons that are available for card messages:

AIRPLANEBOOKMARK
BUSCAR
CLOCKCONFIRMATION_NUMBER_ICON
DESCRIPTIONDOLLAR
EMAILEVENT_SEAT
FLIGHT_ARRIVALFLIGHT_DEPARTURE
HOTELHOTEL_ROOM_TYPE
INVITEMAP_PIN
MEMBERSHIPMULTIPLE_PEOPLE
PERSONPHONE
RESTAURANT_ICONSHOPPING_CART
STARSTORE
TICKETTRAIN
VIDEO_CAMERAVIDEO_PLAY

Thefollowing is an example of a card with an email icon:

Use Google Material icons

You can useGoogle Material iconsto select from over 2500+ icon options and customize theweight, fill, and grade of the icons.

The following is an example of card with a Google Material icon:

Use custom icons

To add a custom icon, include theiconUrl field and specify the icon'scorresponding URL.

The following is an example of a custom icon:

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-11 UTC.