/api/v1/convert/markdown-to-textMarkdown → Plain text API
Strip markdown formatting and return prose.
POST /api/v1/convert/markdown-to-text strips every markdown marker — headings, emphasis, links, images, tables, fences — and returns clean, indexable plain text suitable for emails, SMS, OG descriptions, and search.
Overview
Removes all markdown syntax — headings, emphasis, code fences, links, images, tables, lists, blockquotes — and returns plain text. Useful for email previews, SMS, OG descriptions, search indexing, and accessibility tooling.
Request
Authenticate with Authorization: Bearer YOUR_API_KEY and send a JSON body containing the parameters below. Pick your language:
curl -X POST 'https://trymarkdownviewer.com/api/v1/convert/markdown-to-text' \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"markdown":"# Hello\n\nVisit **[the site](https://example.com)**."}'Body parameters
| Field | Type | Required | Description |
|---|---|---|---|
| markdown | string | required | Markdown source. |
Response
Success responses are wrapped in a data field. Errors use { error: { code, message } } with an appropriate HTTP status — see the error reference.
{
"data": {
"text": "Hello\n\nVisit the site.",
"characters": 22,
"words": 4
}
}Use cases
OG / Twitter card descriptions
Pull the first ~160 characters of plain text for sharing previews.
Search index ingest
Feed clean prose into Algolia / Meilisearch instead of raw markdown.
Email rendering
Provide a plain-text alternative alongside the HTML version of an email.
Production tips
- Output preserves paragraph breaks (double newlines) so layout-aware tools can wrap correctly.
Related endpoints
Try in browser
Free tools that run the same logic locally — no API key, no upload.
Try it
Send a real request against your account in the API playground. Errors there link straight back to the error reference.