For developers

Add DOCX → Markdown to your Dart app.

This site is a thin shell around docx_to_markdown - the same open-source package you can drop into any Dart or Flutter project. Here is how to use it.

Install

Add the package with a single command:

Terminal
dart pub add docx_to_markdown
# Flutter:
flutter pub add docx_to_markdown

Convert a document

The converter works on bytes, so load the file however you like. It never touches the disk or network unless you ask it to.

main.dart
import 'dart:io';
import 'package:docx_to_markdown/docx_to_markdown.dart';

Future<void> main() async {
  final bytes = await File('document.docx').readAsBytes();

  // Defaults: GitHub Flavored Markdown, footnotes on, tables auto.
  final markdown = await DocxConverter(bytes).convert();

  print(markdown);
}

Tune the output

Pass a DocxToMarkdownConfig. Every option has a sensible default, so override only what you need - flavor, tables, image sizing, metadata, tracked changes and more.

config.dart
final config = DocxToMarkdownConfig(
  flavor: MarkdownFlavor.commonmark,
  tableMode: TableMode.auto,
  imageSizeMode: ImageSizeMode.obsidian,      // ![alt](img.png =300x200)
  metadataMode: MetadataMode.yamlFrontMatter, // prepend YAML front matter
);

final markdown = await DocxConverter(bytes, config: config).convert();

On the web

There is no filesystem in the browser, so images flow through an imageAssetSink you control - exactly how this website exports them. (It is the same code path running right now.)

web.dart
// On the web there is no filesystem, so route image bytes to a sink.
final images = <DocxImageAsset>[];

final markdown = await DocxConverter(bytes).convert(
  imageAssetSink: (asset) {
    images.add(asset);                 // keep the bytes...
    return 'images/${asset.suggestedFilename}'; // ...and reference them here
  },
);

Extend it with hooks

Rewrite links and image targets, transform or drop blocks and inlines, convert equations to LaTeX, or collect warnings - all without forking.

hooks.dart
final hooks = DocxToMarkdownHooks(
  rewriteImageTarget: (src, [ctx]) => 'https://cdn.example.com/$src',
  transformBlock: (block, ctx) => block is TableBlock ? null : block, // drop tables
  onWarning: (w, ctx) => print('[${w.code}] ${w.message}'),
);

final md = await DocxConverter(
  bytes,
  config: DocxToMarkdownConfig(hooks: hooks),
).convert();