Short answer: to get text to speech with emotion, write the emotion into the text with Grok's speech tags: [sigh], [laugh] or [cry] where the sound happens, and <whisper>…</whisper>, <soft>…</soft> or <loud>…</loud> around the words that should change. The box above is pre-filled with a line that sighs, softens, laughs and whispers; the emotion buttons load a ready-made line for happy, sad, scared, angry, calm or excited. Pick one of 28 voices, press Generate and listen. Trying it needs no account.
How to add emotion to text to speech
- Pick an emotion above the box, or keep the mixed sample line. Each button replaces the text with a short tagged line, so you can see which tags it uses before you hear it.
- Or write your own. Put the cursor where a sound belongs and press a chip under Add expression:
[sigh],[laugh]and the rest are inline tags. To change how a phrase is spoken, select it and press a wrapping tag such as<whisper>or<emphasis>; More tags has all 26. - Pick a voice. Every voice accepts the same tags; the clips above use Eve.
- Press Generate and listen. Signed in, you can download the MP3.
How Grok does emotion: tags, not a mood setting
Grok text to speech has no "happy" or "angry" switch. Emotion comes from 26 speech tags documented in xAI's text to speech docs, in two kinds:
- 14 inline tags written as
[tag]add a sound or a gap at that spot:[laugh],[chuckle],[giggle],[cry],[sigh],[breath],[inhale],[exhale],[pause],[long-pause],[hum-tune],[tsk],[tongue-click],[lip-smack]. - 12 wrapping tags written as
<tag>…</tag>change how the phrase inside is spoken:<whisper>,<soft>,<loud>,<build-intensity>,<decrease-intensity>,<higher-pitch>,<lower-pitch>,<slow>,<fast>,<emphasis>,<sing-song>,<singing>.
The tags are never read out, but they are part of the text you send, so they count toward the character limit. A word that is not on the list, such as [gasp] or [angry], is not a tag and may be spoken as a word.
In the two pre-recorded clips above, the same line in the same voice runs 6.5 seconds without tags and 9.0 seconds with them: the sigh, the pause and the laugh take time of their own. Expect the same voice with sounds and volume changes added, not a different voice or a different reading of the plain words.
The six emotion buttons, and why they use those tags
The tag names are xAI's; which tags make which mood is our suggestion, and the model follows the tags, not the button's name. Change any of them.
| Emotion | Tags in the line | Idea |
|---|---|---|
| Happy | [laugh], <higher-pitch>, [giggle] | laughter around the good news, a lifted phrase |
| Sad | [sigh], <soft><slow>, [breath] | a sigh to open, the hard sentence soft and slow |
| Scared | [breath], <whisper>, [pause], <build-intensity> | a breath, a whispered question, a rising line |
| Angry | <loud>, [pause], <emphasis>, [exhale] | the accusation loud, one word stressed, an exhale |
| Calm | <soft><slow>, [pause], [exhale] | everything soft and slow with room to breathe |
| Excited | <fast>, [inhale], <build-intensity>, [laugh] | a rushed opening, a line that keeps growing |
Tips for emotion that sounds natural
These follow xAI's own advice in its docs:
- Pair a tag with punctuation.
Really? [laugh] That's incredible!lands better than three tags in a row. - Wrap phrases, not single words.
<soft>I will stay.</soft>reads better than softening one word. - Nest wrapping tags for combined effects.
<slow><soft>Goodnight, sleep well.</soft></slow>is slower and softer. - Give a mood room.
[pause]and[long-pause]before a line let the change register;<build-intensity>and<decrease-intensity>need a whole sentence to happen in. - Try two or three voices. The same tagged line can land differently from voice to voice; the voices page has every voice reading one sentence, and the whisper, shouting and singing pages each do a whole script in one tag.
Limits, price and privacy
Signed out, you get 3 previews a day of up to 200 characters, played on the page; a free account adds MP3 download, and a Google account raises the limit to 1,000 characters per clip. The tag characters count toward the limit. Your text goes to xAI's model through our Cloudflare function to make the audio and is not stored.
If you build your own app, the same tags go straight into the text field of POST https://api.x.ai/v1/tts, at $15 per million characters; see the pricing calculator and the Grok Voice API guide. There is no separate price for emotion; xAI bills text to speech per character, tags included.
Last updated: