Open-source project
RICHQAQ/PasteMD avatar
RICHQAQ/PasteMD

PasteMD: paste Markdown and AI chat output into Word, WPS and Excel

一键将 Markdown 和网页 AI 对话(ChatGPT/DeepSeek等)完美粘贴到 Word、WPS 和 Excel 的效率工具 | One-click paste Markdown and AI responses (ChatGPT/DeepSeek) into Word, WPS, and Excel perfectly.

5,303 stars323 forksPythonAGPL-3.0

At a glance

What is it?
PasteMD is a Windows tray utility that reads Markdown or HTML from the clipboard, converts it through Pandoc, and inserts the result at the cursor in Word, WPS or Excel. It solves a narrow, real problem, and it pays for that narrowness with a hard dependency on Pandoc and a Windows-first design.
Who is it for?
Adopt PasteMD if you write on Windows and spend your day moving AI answers or Markdown drafts into Word, WPS or Excel, and you accept that Pandoc sits underneath the whole thing. Skip it if you need a headless converter, a Linux target, or a tool you can script from a pipeline, because the design is a tray app driven by a global hotkey and a clipboard.
Can I use it commercially?
Yes, with strict conditions. AGPL-3.0 is a network copyleft licence: if people use a modified version over a network, for example as a hosted service, you must offer them its source code under the same licence.
Is it still maintained?
Yes. The repository last received commits 14 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

The clipboard gap between AI chats and office documents

The README opens with the exact complaint it was built around: formulas copied out of ChatGPT or DeepSeek arrive in Word as garbled text, and Markdown tables copied into Excel simply do not land. That is a formatting problem, not a content problem. The text is already correct in the browser; what breaks is the translation step between a Markdown or HTML clipboard payload and the OOXML that Word and WPS expect.

PasteMD is for people who live in that gap. Students writing papers, analysts pasting AI-generated tables into spreadsheets, anyone who copies an answer out of a chat window and wants the headings, lists, tables and math to survive the trip. It is not a general Markdown editor and it is not a document converter you drive from a shell. It is a resident tray process whose whole job is to intercept one hotkey and rewrite one clipboard.

How PasteMD turns a clipboard payload into a DOCX insertion

The mechanism described in the repository is a short chain. A global hotkey, `Ctrl+Shift+B` by default, fires. The tool reads the clipboard, decides whether the payload is Markdown, HTML rich text, LaTeX or a file, then routes it: Markdown and HTML go through Pandoc into DOCX, and a recognised Markdown table goes to Excel instead. The result is inserted at the cursor of the foreground application, which PasteMD detects as Word or WPS and opens if needed.

The dependency list in `requirements.txt` confirms the shape of the process. `pyperclip` handles the clipboard, `pynput` and a forked `pystray` handle the hotkey and the tray icon, `python-docx` and `openpyxl` handle document and workbook objects, `beautifulsoup4` and `lxml` parse HTML, and `mathml2omml-as` converts MathML into OMML, the math markup Word actually understands. That last package is the reason formulas can survive at all; without an OMML conversion step, LaTeX or MathML would land as plain text.

The application-extension feature is the part worth reading twice. Paste modes can be bound per application or per window title, so 语雀 or QQ can be given a different treatment than Word. That is a sensible escape hatch, because a single global hotkey that always does the same thing would be wrong for at least some windows on any real desktop.

Installing PasteMD and running the first paste

The README points at the Releases page and lists two artefacts. The portable `PasteMD_vx.x.x.exe` build is marked as no longer provided and would have required a Pandoc install on your PATH; the recommended one is `PasteMD_pandoc-Setup.exe`, described as an all-in-one installer that bundles Pandoc so no separate environment setup is needed.

So the install is a download and a run of that installer. There is no package manager command in the README and no `pip install` instruction for end users, even though the project is Python. If you want to build from source instead, the repository ships `main.py`, `PasteMD.py`, `requirements.txt` and `installer.iss`, but the README does not walk through that path.

After installing, the workflow is four steps. Open Word, WPS or Excel and put the cursor where the content should go. Copy Markdown or web content to the clipboard. Press the hotkey.

bash
Ctrl+Shift+B

The README states that a notification appears in the bottom right corner reporting success or failure, and that a Markdown table is routed to Excel when Excel is already open while ordinary Markdown or web content becomes a DOCX inserted into Word or WPS. First run also writes a config file you can edit by hand, at `%APPDATA%\PasteMD\config.json` on Windows or `~/Library/Application Support/PasteMD/config.json` on macOS.

json
{
  "hotkey": "<ctrl>+<shift>+b",
  "pandoc_path": "pandoc",
  "reference_docx": null,
  "save_dir": "%USERPROFILE%\\Documents\\pastemd",
  "keep_file": false,
  "notify": true,
  "enable_excel": true,
  "excel_keep_format": true,
  "paste_delay_s": 0.3,
  "no_app_action": "open"
}

Two keys deserve attention before you change anything. `reference_docx` is where you point PasteMD at a Word template so the generated DOCX inherits your styles rather than Pandoc defaults, and `paste_delay_s` is a timing knob. A delay setting that exists at all tells you the insertion is a synthetic paste racing against the target application becoming ready, which is the usual source of flakiness in this class of tool.

Where PasteMD breaks: formulas, platform and the Pandoc dependency

The compatibility table in the README is unusually honest and is the most useful page in the project. It distinguishes four copy modes: Markdown without formulas, Markdown with formulas, web content without formulas, and web content with formulas. Several cells are not perfect. ChatGPT Markdown with formulas is marked as showing formulas as code, meaning you still open the equation editor. Kimi, 通义千问 and Doubao web-content copies with formulas are marked as losing the formula entirely. Doubao additionally needs the browser's clipboard-read permission enabled before the web-content path works at all.

That table is a real limitation, not a footnote. If your workflow is copying rendered AI answers containing math out of Kimi or 通义千问, PasteMD will not save you the retyping. Switching to the site's own copy button, which produces Markdown, is the workaround the table implies.

The second constraint is the platform. The badges list Windows, Word and WPS, and `requirements.txt` guards `pywin32`, `win10toast` and `win11toast` behind `platform_system == "Windows"`. macOS dependencies exist (`pync`, and a `build_macos.sh` plus `build_dist_dmg.sh` in the repository root), but the README's install instructions and the compatibility discussion are written around Windows and the bundled installer. Treat macOS as source-build territory until the documentation says otherwise.

The third is Pandoc. Every conversion goes through it. The bundled installer hides that, but it does not remove it: a Pandoc failure is a PasteMD failure, and the README does not document rollback or what happens to your clipboard when a conversion errors out. The tray does offer log viewing, which is where you would look.

PasteMD against Pandoc on its own and against Pandoc plus a script

The obvious alternative is Pandoc by itself. Pandoc already converts Markdown to DOCX and handles LaTeX math through its own writers. What it does not do is watch your clipboard, detect that Word is in the foreground, and insert at the cursor. Pandoc is a batch converter: you give it a file, it gives you a file. PasteMD is the ergonomic layer that removes the save-a-file step.

The second alternative is a personal script: a hotkey daemon plus `pandoc -o out.docx` plus a call into Word's COM interface to insert the result. That is essentially what PasteMD is, and building it yourself buys you control over the exact conversion flags and the insertion method. It costs you the parts that are tedious rather than hard, which are the per-application routing, the HTML rich-text path, the MathML-to-OMML conversion, and the Excel table detection. If your needs are one format and one target application, the script wins on simplicity. If you want the table-to-Excel branch and the per-window paste modes, you are reimplementing PasteMD.

A third option is to stop fighting the clipboard and use an editor that exports natively. That works until the content originates in a browser chat window you do not control.

Maintenance, releases and the AGPL-3.0 licence

The last push to the default branch was on 2026-09-02, and the repository is not archived. Recent releases run v0.1.7.3 on 2026-07-22, v0.1.7.4 on 2026-08-07, and v0.1.7.5rc1 on 2026-08-08. The cadence is frequent and the version numbers are still in the 0.1.x range, with a release candidate in the mix. That combination says the project is moving, and also that interfaces and configuration keys can still change between point releases. Pin a known-good installer rather than always grabbing the newest one if you depend on it for daily work.

Upgrade cost is low in the normal case: run a newer installer, and your `config.json` in `%APPDATA%\PasteMD\` persists. The risk sits in that file. A new key or a changed default in a 0.1.x release is not something the README promises to announce.

The licence is AGPL-3.0. For an individual running the tray app, that is unremarkable. For anyone embedding PasteMD's code into a service or shipping a modified build, the AGPL's network-use clause is the part to read carefully, and it is worth a lawyer's time rather than a blog post's. The repository also carries a `THIRD_PARTY_NOTICES.md`, which is where the bundled Pandoc's own licence, and the licences of the vendored forks of `pystray` and `mathml2omml-as`, should be accounted for.

Editorial conclusion

Adopt PasteMD if you write on Windows and spend your day moving AI answers or Markdown drafts into Word, WPS or Excel, and you accept that Pandoc sits underneath the whole thing. Skip it if you need a headless converter, a Linux target, or a tool you can script from a pipeline, because the design is a tray app driven by a global hotkey and a clipboard. Verify first that the bundled installer from the Releases page runs on your machine and that your AI site of choice appears in the compatibility table for the copy mode you actually use; the README marks ChatGPT Markdown with formulas as showing LaTeX as code, and Kimi, 通义千问 and Doubao web-content copies with formulas as losing the formula entirely.

Frequently asked questions

What is PasteMD and what problem does it solve?

PasteMD is a tray utility that reads Markdown or HTML from the clipboard, converts it with Pandoc, and inserts the result at the cursor in Word, WPS or Excel. The README describes it as a fix for formulas from ChatGPT or DeepSeek arriving garbled in Word and for Markdown tables failing to paste into Excel.

How do I install PasteMD?

Download `PasteMD_pandoc-Setup.exe` from the Releases page. The README describes it as an all-in-one installer that bundles Pandoc, so no separate environment setup is needed. The older portable `PasteMD_vx.x.x.exe`, which required Pandoc on your PATH, is marked as no longer provided.

Does PasteMD work without Pandoc installed?

The bundled installer includes Pandoc, so you do not install it separately. The portable build that required a system Pandoc is no longer offered, and the config key `pandoc_path` defaults to `pandoc`, which is what the tool invokes.

Which AI sites does PasteMD support for pasting into Word?

The README's compatibility table covers Kimi, DeepSeek, 通义千问, Doubao, 智谱清言/ChatGLM, ChatGPT, Gemini, Grok and Claude. Markdown copies without formulas are marked as perfectly supported across all of them; the failures are concentrated in formula handling for some sites and copy modes.

Why do formulas from ChatGPT show up as code in Word with PasteMD?

The README's table marks ChatGPT Markdown with formulas as showing formulas as code, meaning the LaTeX appears as text and you finish it in the Word or WPS equation editor. For Kimi, 通义千问 and Doubao, web-content copies with formulas are marked as losing the formula entirely.

What is the default PasteMD hotkey and where is the config file?

The default hotkey is `Ctrl+Shift+B`, stored as `"<ctrl>+<shift>+b"`. The config file is written to `%APPDATA%\PasteMD\config.json` on Windows and `~/Library/Application Support/PasteMD/config.json` on macOS, and it can be edited by hand.

Official sources

  1. License: AGPL-3.0
  2. Project website
  3. README
  4. Releases
  5. RICHQAQ/PasteMD on GitHub
Community notes

Community notes