Open-source project
RICHQAQ/PasteMD avatar
RICHQAQ/PasteMD

PasteMD routes clipboard content three ways, and Pandoc does the converting

A one-click productivity tool to paste Markdown and AI chat responses (ChatGPT/DeepSeek, etc.) perfectly into Word, WPS and Excel.

5,441 stars321 forksPythonAGPL-3.0

At a glance

What is it?
PasteMD is a tray tool that reads Markdown from the clipboard, hands it to Pandoc, and drops a DOCX into Word or WPS, or a table into Excel when one is already open. The conversion quality is Pandoc's, the routing is the tool's, and the project's own compatibility table admits where the math gets lost.
Who is it for?
PasteMD fits a writer who moves AI answers and Markdown tables into Word or spreadsheets every day and already accepts Pandoc as the converter. It does not fit anyone who needs the original formula back from sites that drop it, and the portable build is no longer offered, so plan on the installer that carries Pandoc.
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 3 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 November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • RICHQAQ/PasteMD5,441 ★ · +145
Star history
Repository2026-09-142026-11-15
RICHQAQ/PasteMD5.3k5.4k

145 Stars in the last 62 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

One hotkey, and Pandoc does the actual converting

PasteMD lives in the system tray and does three things when you press its hotkey. It reads Markdown from the clipboard, calls Pandoc to convert that text to DOCX, and inserts the result at the cursor position in Word or WPS. The default global hotkey is Ctrl+Shift+B, and the syntax for a different one looks like <ctrl>+<alt>+v. The documented routine is short: open Word, WPS or Excel, place the cursor where the content belongs, copy Markdown or web content to the clipboard, press the hotkey. A notice in the lower right corner reports success or failure. The tray menu adds keeping the generated file, viewing logs and viewing configuration, and the tool also detects whether Word or WPS is in the foreground and can open the target application for you. It runs without a console window and without blocking.

The portable executable is withdrawn; the bundled installer is what remains

Two downloads used to be offered and only one is still there. The portable PasteMD_vx.x.x.exe required Pandoc already installed on your machine and runnable from a command line, and that bullet is struck through in the project's own instructions with a note that it is no longer provided and that you should compile it yourself. What remains is PasteMD_pandoc-Setup.exe, described as an all in one installer that carries Pandoc inside it and needs no extra environment setup. Consequence for anyone who liked a single portable file next to their Pandoc install: that route is closed, and self compiling is the only way back to it. The top level of the repository shows what a build involves, including installer.iss for Windows packaging, build_macos.sh, build_dist_dmg.sh for a disk image, a lua_sample directory and a tests directory.

The clipboard decides whether the text lands in Excel or in a document

One setting decides the routing, and its default matters. enable_excel, true out of the box, makes the tool recognise Markdown tables in the clipboard and paste them into Excel, and the documented behavior says that happens when Excel is already open. Everything else, plain Markdown or copied web content, is converted to DOCX and inserted into Word or WPS instead. That conditional wording is the part to notice: if Excel is not open, a table is not going to reach a spreadsheet. A second setting covers the case where no target application is detected at all. no_app_action defaults to "open", and the other documented values are save for keeping only the file, clipboard for copying the file to the clipboard, and none for doing nothing. Consequence: a reader in a hurry can end up with a file sitting in save_dir instead of text in a document, and the fix is a config value rather than a bug report.

First run writes one config.json into the per user data directory

Configuration is a single hand editable JSON file created on first run. On Windows it lands at %APPDATA%\\PasteMD\\config.json, on macOS at ~/Library/Application Support/PasteMD/config.json. The opening of the generated file looks like this.

json
{
  "hotkey": "<ctrl>+<shift>+b",
  "pandoc_path": "pandoc",
  "reference_docx": null,
  "keep_file": false,
  "notify": true,
  "startup_notify": true,
  "enable_excel": true,
  "excel_keep_format": true,
  "paste_delay_s": 0.3,
  "no_app_action": "open",
  "md_disable_first_para_indent": true,
  "html_disable_first_para_indent": true,
  "html_formatting": {
    "strikethrough_to_del": true
  },
  "move_cursor_to_end": true,
  "Keep_original_formula": false,
  "enable_latex_replacements": true,
  "fix_single_dollar_block": true
}

pandoc_path points at the Pandoc executable, reference_docx takes an optional Pandoc reference template, and keep_file decides whether the generated DOCX survives while save_dir says where it goes when it does. paste_delay_s sits at 0.3 seconds, documented as a pause before pasting because writing the clipboard on Windows sometimes takes a moment. The interface language is a separate setting with zh-CN, en-US and ja-JP as its values.

Six defaults quietly rewrite your formatting before Pandoc sees it

Several settings change the output without announcing themselves. enable_latex_replacements repairs LaTeX that Pandoc will not accept, with the documented example of rewriting {\\kern 10pt} into \\qquad. fix_single_dollar_block finds a lone $ ... $ sitting on its own line and turns it into $$ ... $$, which is what makes text that looks inline render as a display formula. excel_keep_format, on by default, is what carries bold, italic and code formatting from a Markdown table into Excel. md_disable_first_para_indent and html_disable_first_para_indent both force the first paragraph into plain body style, and move_cursor_to_end, on by default, leaves the caret sitting after the pasted text. Under html_formatting, strikethrough_to_del converts strikethrough markup into a <del> tag, and Keep_original_formula leaves the original LaTeX in place. Consequence: if your own reference template already deals with indentation or formulas, these defaults can be undoing your work, and the fix is to turn them off one at a time.

Pandoc filters are the extension point, and they run in list order

Extension happens through Pandoc rather than through new code in the tool. pandoc_filters takes a list of .lua scripts or executable paths and runs them in the order given, described as the way to extend conversion with custom format handling and special syntax conversion. The documented example is ["%APPDATA%\\npm\\mermaid-filter.cmd"], a path under the npm configuration directory, offered as a way to get Mermaid diagram support. A second setting, pandoc_filters_by_conversion, narrows the list per conversion type, with md_to_docx and html_to_md named as the kinds of values it takes. pandoc_request_headers attaches Header: Value lines when Pandoc fetches remote resources, which matters when an image reference points at a host that checks what it receives. Consequence: filters are files that have to exist on your own machine, so a stale path or an uninstalled filter surfaces as a conversion failure, not as a configuration error.

The compatibility table is where the tool admits formulas get lost

The project tests copy and paste against nine AI chat sites, with separate columns for copying the Markdown form of an answer and for selecting the answer as rich text. Two of the Chinese services in that table lose the math when you copy the rendered answer: the formulas disappear and you have to enter them again with the formula editor in Word or WPS. ChatGPT fails differently, since copying its Markdown with formulas arrives as LaTeX code that also needs the formula editor, while its rich text path passes. Another site needs a browser permission enabled before copying web content that contains formulas, switched on from the icon at the left of the address bar. The two copy modes are worth separating: pressing the copy button on a reply usually yields Markdown, sometimes with HTML attached, while selecting the text with the mouse yields HTML rich text. Consequence: if your working day is one formula heavy chat site, no setting in config.json restores math that was never copied.

Two dependencies come from git master, and the license is AGPL

requirements.txt explains what the Python side needs.

text
psutil
pyperclip
pynput
pystray @ git+https://github.com/RICHQAQ/pystray.git@master
Pillow
plyer
openpyxl
python-docx
beautifulsoup4
lxml
mathml2omml-as @ git+https://github.com/AlloteSoftware/mathml2omml_as.git

pywin32 ; platform_system == "Windows"
win10toast ; platform_system == "Windows"
win11toast ; platform_system == "Windows"
pync ; platform_system == "Darwin"

Most entries are ordinary packages, but two are pulled straight from git rather than a released version, pystray from the maintainer's fork at @master and mathml2omml-as from another repository, which means a rebuild can pick up changes nobody tagged. pywin32, win10toast and win11toast are marked for Windows and pync for Darwin, which lines up with the two config paths and the disk image build script. The license is AGPL-3.0, and THIRD_PARTY_NOTICES.md at the root is where those borrowed components are attributed.

Editorial conclusion

PasteMD fits a writer who moves AI answers and Markdown tables into Word or spreadsheets every day and already accepts Pandoc as the converter. It does not fit anyone who needs the original formula back from sites that drop it, and the portable build is no longer offered, so plan on the installer that carries Pandoc. Before you commit, copy one formula heavy answer from your own chat site, check it in Word, and read the two places where behavior depends on whether Excel or Word is already open.

Frequently asked questions

How do I paste Markdown into Word with RICHQAQ/PasteMD?

Install PasteMD_pandoc-Setup.exe from the releases page, open Word or WPS, put the cursor where the text should land, copy Markdown or web content to the clipboard, and press the default hotkey Ctrl+Shift+B. The result is converted to DOCX by Pandoc and inserted at the cursor, with a notice in the lower right corner.

Can you paste Markdown in Word using RICHQAQ/PasteMD?

Yes, and a Markdown table is routed elsewhere. Plain Markdown or copied web content becomes DOCX and goes into Word or WPS, while enable_excel, true by default, sends recognized Markdown tables to Excel when Excel is already open. Formulas copied as rendered web content from some sites are lost and must be retyped with the formula editor.

What does copy Markdown mean in RICHQAQ/PasteMD?

It describes the clipboard format before conversion. Pressing the copy button on an AI reply usually puts Markdown on the clipboard, sometimes with HTML attached, while selecting the reply text with the mouse copies HTML rich text. PasteMD reads either form and hands it to Pandoc.

Official sources

  1. License: AGPL-3.0
  2. Project website
  3. README
  4. Releases
  5. RICHQAQ/PasteMD on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/richqaq-pastemd.svg)](https://hysenlabs.com/projects/richqaq-pastemd)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/richqaq-pastemd.svg)](https://hysenlabs.com/projects/richqaq-pastemd)

Was this useful?