Plain Text vs Formatted Output
When to request clean plain text vs rich markdown output.
The Plain Text Case
Markdown formatting is powerful — but it is not always the right choice. Many real-world applications need clean, unformatted text where markdown symbols would appear as literal characters rather than rendered formatting.
Knowing when to ask for plain text is as important as knowing how to ask for rich formatting.
When Plain Text Is Required
Use plain text output when your environment does not render markdown:
- Email copy: most email clients show raw asterisks
- SMS and push notifications: no formatting support
- Voice output: text-to-speech reads '** bold **' literally
- CRM and help desk fields: many do not render markdown
- API data processing: when the text will be stored or further processed
- Legacy system input fields: plain text only
import anthropic
client = anthropic.Anthropic(api_key='sk-ant-your-key-here')
response = client.messages.create(
model='claude-opus-4-5',
max_tokens=200,
messages=[{
'role': 'user',
'content': (
'Write a 120-character push notification for a flash sale ending in 2 hours. '
'Plain text only — no emojis, no markdown, no asterisks, no special characters. '
'Must include: urgency, discount percentage (30%), and category (electronics). '
'Output the notification text only — nothing else.'
)
}]
)
print(response.content[0].text)All lessons in this course
- Requesting Lists and Bullet Points
- Asking for Tables and Structured Data
- Markdown Formatting in Prompts
- Plain Text vs Formatted Output