SuperAPI AI Directory

markdown-to-whatsapp

Convert Markdown to WhatsApp formatting so agent output shows bold, lists and quotes instead of raw asterisks, with tables rendered as monospace boxes.

Open website

About this tool

Purpose

markdown-to-whatsapp is used to solve the incompatibility between WhatsApp and standard Markdown formatting. WhatsApp uses non-standard syntax: bold, italic, ~strikethrough~, which is similar to but not exactly the same as Markdown. This tool converts Markdown sources from text editors, Google Docs, etc. into the format expected by WhatsApp, saving the trouble of manual correction.

Main capabilities

Format conversion: bold **text** → *text*; italic *text* or _text_ → _text_; strikethrough ~~text~~ → ~text~; inline code `code` → `code`; bold italic ***text*** → _*text*_.

Headings: converted to bold with a level emoji prefix, such as ### H3 → *🟡 H3*; the emoji prefix can be turned off in the interface.

Lists: unordered lists use the * prefix, with nesting levels marked by ◦ ; ordered lists keep their numbering, with nesting levels marked by ◦ ; task lists - [x] → ☑,- [ ] → ☐, also supported in ordered lists.

Tables: two styles are provided (global or per-table selection): Auto (default) draws tables in a monospace block, with width not exceeding the bubble width, and falls back to a bulleted list when it cannot be drawn; List always uses a bulleted list. The list layout has three grouping modes: Pairs (two columns, key-value pairs), Columns (3 or more columns, comparison matrix), Rows (all other cases). Attribute words are matched word by word in 11 languages. The table frame degrades step by step by removing padding column by column, switching to compact borderless, wrapping, etc., until it fits monoWidth, and finally becomes a list. Column widths are measured by display units, supporting alignment for emoji and CJK text. Column alignment (:---、:---:、---:) is effective in the frame and compact styles. Borders use pure ASCII (+-|=), because monospace fonts in WhatsApp and similar apps do not have box-drawing glyphs.

Other handling: links [text](url) → text (url); autolinks are rendered as bare URLs; HTML entities are decoded, common named entities are supported, and rare references are left as-is; inline HTML tags are converted or stripped; code blocks keep triple backticks, and internal triple backticks are replaced with ˋˋˋ; horizontal rules --- → ───────────────; escape characters use Unicode lookalike characters (∗、_、∼) to prevent WhatsApp from misparsing; formatting inside words is ignored; punctuation marks serve as valid boundaries.

Usage

Web version: open https://drsound.github.io/markdown-to-whatsapp/ , paste, type, or drag Markdown into the left panel, and the right side shows a WhatsApp bubble preview, which can be copied or shared via wa.me. The interface supports light and dark themes, and options are stored in localStorage.

npm library / CLI:npm i markdown-to-whatsapp, Node 20 or newer. CLI options include --width(10–80)、--tables auto|list、--layout auto|rows|columns|pairs、--separator、--no-emoji、--json , etc.

MCP server:npx markdown-to-whatsapp mcp, runs via stdio, exposes the tool convert_markdown_to_whatsapp, accepts markdown and optional parameters monoWidth, tableFormat, listLayout, rowSeparator, headingEmojis. Returns text and structured results, including each table's key, columns, fitsBox, asList, listLayout. The tool is read-only and idempotent.

Called as a library: exports convertTextToWhatsapp(markdown, options) and convertToBlocks(markdown, options). Options include tableFormat (auto|list), monoWidth, rowSeparator, headingEmojis, listLayout (auto|rows|columns|pairs), tableOverrides (an array indexed by table position or an object keyed by key). The old names tableThreshold, ascii/always are still accepted, with the new names taking precedence. borderStyle is accepted but ignored.

Use cases

For users who need to send Markdown content to WhatsApp, especially agent output containing complex formatting such as tables and lists, avoiding manual format adjustments. The MCP server mode is suitable for letting the agent convert text itself, especially the part where table column widths must match the phone bubble width, which models easily get wrong.

Limitations

Based on the materials, this tool does not provide server-side processing; everything runs locally; table frame width is limited by the monospace character width on phones (default 26 characters), so tables wider than the bubble cannot be drawn; monospace font fallback may cause emoji and CJK alignment to be best-effort; very long messages cannot be shared via link and must be copied manually; some rare HTML entities (Greek letters, mathematical symbols) are left as-is.