Home · Docs · Import + Export · Importing Word (.docx)

Importing Word (.docx)

Word documents convert client-side via mammoth → turndown. Headings, lists, tables, links, images, bold/italic survive. Macros and complex layouts are dropped.

.docx files convert entirely in your browser — no server roundtrip. The pipeline is:

  1. Mammoth unzips the .docx and walks the XML to produce semantic HTML
  2. Turndown (with GFM tables) walks the HTML and emits Markdown
  3. Any embedded images are extracted, uploaded to our R2 storage via /api/images/upload, and rewritten as ![alt](url) in the output

We picked HTML as the intermediate (rather than mammoth’s built-in markdown writer) because Turndown + GFM gives much better fidelity on real-world Word docs.

Q4 Roadmap.docx — Microsoft Word

Q4 Roadmap

The fourth quarter is structured around three releases.

  • Identity v2 ships in October.
  • Org audit log ships in November.
  • SSO + SCIM ships in December.
ReleaseMonthOwner
Identity v2OctSam
Audit logNovLee
SSO + SCIMDecAvery
Q4 Roadmap — sweetdocs

Q4 Roadmap

The fourth quarter is structured around three releases.

  • Identity v2 ships in October.
  • Org audit log ships in November.
  • SSO + SCIM ships in December.
ReleaseMonthOwner
Identity v2OctSam
Audit logNovLee
SSO + SCIMDecAvery

What survives the conversion

Word elementMarkdown result
Title / Heading 1-6# through ######
ParagraphsPlain paragraphs
Bold, italic, strikethrough**bold**, *italic*, ~~strikethrough~~
Bulleted lists, numbered lists- and 1. lists with proper nesting
TablesGFM pipe tables, header row preserved
Hyperlinks[text](url) inline links
Inline code, code blocks`inline` and fenced blocks
Embedded images (.png, .jpeg, etc.)Uploaded to our storage and embedded as ![alt](url)
Blockquotes> blockquotes

What’s lost or simplified

Word elementResult
Page-level layout (margins, columns, headers, footers)Dropped — Markdown is flow content, not page-based
Complex tables (merged cells, nested tables)Cells preserved; merges flatten
Macros, VBA, ActiveXStripped
Comments, tracked changes, revisionsNot imported
Footnotes, endnotesInline-bracketed as plain text (sweetdocs doesn’t support footnote Markdown — see Markdown essentials)
Equations (OOXML math)Dropped (no math support in v1)
Drawing canvas, SmartArt, chartsDropped
Embedded videos, OLE objectsDropped
Specific fonts and colorsDropped — sweetdocs uses your theme

Image handling

When mammoth encounters an embedded image, our convertImage callback:

  1. Reads the image bytes from the .docx archive
  2. Runs them through the same client-side optimizer used for paste/drop uploads (HEIC transcode, EXIF strip, AVIF re-encode, resize) — see Adding images
  3. POSTs the result to /api/images/upload (with your auth token)
  4. Replaces the <img> with <img src="<r2-url>"> in the intermediate HTML

If an upload fails (quota, network), that image is dropped from the output and a warning surfaces:

2 images couldn’t be uploaded.

The rest of the import still succeeds — broken images don’t fail the whole conversion.

Errors specific to .docx

CauseMessage
File isn’t a valid .docx (wrong format / corrupted)“Couldn’t read filename.docx”
Image upload quota hit mid-importWarning per failed image; the import still completes
Auth missing for image uploadSame — images skipped, doc imports with warning

What if the result needs cleanup?

Real Word documents vary widely. Common things to clean up after import:

The AI Author panel can clean up an imported doc in one prompt: “Tighten this imported Word doc — remove excess blank lines and merge fragmented paragraphs.”