Word to Markdown / HTML API

Convert a Word .docx file to Markdown, clean HTML or plain text, keeping headings, bold / italic, links, numbered and nested lists and tables.

POSThttps://apibox.io.vn/v1/docx-convert

The DOCX converter reads a Word document and rewrites its content as Markdown (default), clean HTML (format=html, no inline styles) or plain text. Headings come from the Word heading styles (Title, Heading 1–6), bold and italic runs become bold / _italic_, hyperlinks keep their URL, bulleted and numbered lists keep their nesting and numbering, and tables become Markdown or HTML tables.

Besides content, the answer lists the headings (an outline of the document), the title and author from the document properties, and stats (paragraphs, list items, tables, words, characters), handy to check an upload or to index the text in a search engine.

Images, comments, headers and footers and tracked changes are not converted. Old .doc files are not supported: save them as .docx first. Files are processed in memory within the file size of your plan and never stored.

Parameters

NameInTypeRequiredDefault
filebodyfileyesThe .docx file (multipart, raw body or file_base64).
formatquery|bodystringnomarkdownmarkdown, html or text.

Example

curl -X POST "https://apibox.io.vn/v1/docx-convert" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "0=@./my-file"

Response

{
  "format": "markdown",
  "title": "HĐ mẫu",
  "author": "APIBox",
  "modified": null,
  "content": "# Hợp đồng dịch vụ\n\n# Điều 1. Phạm vi\n\nBên A **cung cấp** dịch vụ _API_ cho Bên B.\n\n[Xem tài liệu](https://apibox.io.vn/docs/)\n\n1. Bước một\n2. Bước hai\n   1. Chi tiết a\n\n- Điểm chấm\n\n| Gói | Giá |\n| --- | --- |\n| Pro | 15 USD |\n\nHết.",
  "headings": [
    {
      "level": 1,
      "text": "Hợp đồng dịch vụ"
    },
    {
      "level": 1,
      "text": "Điều 1. Phạm vi"
    }
  ],
  "stats": {
    "paragraphs": 3,
    "list_items": 4,
    "tables": 1,
    "words": 40,
    "characters": 160
  },
  "note": "Images, comments, headers / footers and tracked changes are not converted."
}

Use cases

  • Publish Word articles on a website or CMS as Markdown
  • Index the text of uploaded contracts and reports
  • Feed Word documents to an AI pipeline as clean text
  • Migrate internal documentation to a wiki or Git

FAQ

Are images kept?

No, only text, lists, links and tables are converted. Images, text boxes and comments are skipped.

Does it read .doc or .odt?

No, only .docx (Word 2007 and later). Save other formats as .docx first.

How are headings detected?

From the paragraph style: Title and Heading 1 give #, Heading 2 gives ##, and so on. Bold text in a normal paragraph is not treated as a heading.

Related APIs

Start with 1,000 free requests every month. Get free API key →