ChatGPT to Markdown Exporter is a browser userscript that converts loaded conversation content into a Markdown file for editing and archiving in tools such as Typora.
Copying a useful answer into notes can lose code formatting, mathematical notation, or links. The userscript in this repository adapts an earlier Chrome-extension project into a script that runs on supported conversation pages.
It works with the page already rendered in the browser. It is not an account-wide export system and should not be assumed to capture conversations that were never loaded.
Install the userscript version
The README links to a Greasy Fork installation page. Alternatively, inspect ChatGPT-To-Markdown-UserScript.js in the repository and install its contents through your userscript manager.
The repository also retains files and screenshots from the earlier Chrome extension. Instructions for loading an unpacked extension are a different installation method; they are not required just to install this userscript.
The script metadata matches ChatGPT/OpenAI conversation domains and Grok. Matching a domain only allows the script to run there; it does not establish that its selectors still match every current page layout.
Export a loaded conversation
Open the conversation you want to keep, let the relevant messages load, and look for Export Chat. The script builds a preview with Copy, Download, and Close controls.
Download saves chat-export.md. Open it in Typora or another Markdown editor and rename it with a topic and date. Count the question-and-answer turns, then check whether code blocks close correctly and formulas render as expected. Those checks matter more than a tidy-looking preview.
The code pairs selected page elements in order. Unusual layouts, missing messages, or changed DOM structure can therefore affect more than appearance: they can affect which messages are included.
How formulas and code are handled
The script turns headings, lists, links, code blocks, and formulas on the page into Markdown. For formulas, it tries to preserve the underlying LaTeX expression rather than capture the visible equation as an image.
A useful small test conversation contains one code block, one inline equation, one display equation, and a short list. Inspect both the Markdown source and its rendered result.
For example, a display formula should remain recognizable as:
|
|
For complex equations, nested lists, and tables, compare the exported symbols, indentation, and cell order with the original conversation.
Compatibility needs checking
The script must recognize message containers on the page. After a ChatGPT or Grok redesign, Export Chat may still appear while the download is incomplete. Test a short conversation before treating a new export as a complete backup.
If you see No conversation content found, first confirm that the conversation is loaded and that the script is running on the intended page. Then inspect the selectors or report the problem upstream. Reinstalling the same unchanged script will not repair a selector that no longer matches.
If the button remains visible but the download is empty, check recent script updates and feedback. A website redesign may require a script update.
Confirm the script is active on this page
A userscript needs a browser script manager. Opening its source as a webpage does not install it. The Greasy Fork route should present the script name, matching addresses, and an installation confirmation from that manager. If you only see JavaScript text, check the manager first rather than importing the code as an unpacked extension.
Reload the conversation after installation and inspect the manager’s menu to confirm the script is enabled on this site. If you already have another exporter or the older extension, test with one active implementation at a time. Two similarly named buttons make it difficult to know which version produced a file.
For long conversations, scroll to the material you want and allow it to display before exporting. Seeing the last response does not establish that all earlier messages are loaded. Compare the first and last turns in the download with the webpage, then sample the middle. This reveals omissions more clearly than file size alone.
Check a small sample of formatted content
Choose a conversation containing a heading, list, link, code, and an equation. In code blocks, inspect paired triple backticks, indentation, and characters such as < and >. Review the text against the original before running exported code.
For formulas, inspect both source and preview. $...$ commonly denotes inline math and $$...$$ display math, but rendering also depends on the editor. If the markers are present while Typora shows plain text, check its mathematics settings before concluding that extraction failed.
A missing table separator can shift a whole row. Follow links too: correct visible text does not establish a correct destination. Verify formatting and completeness before rewriting the material into polished notes. Otherwise it becomes harder to tell whether a mistake happened during export or later editing.
Give each export an identifiable home
The default chat-export.md name can produce a string of numbered downloads. Create a topic folder and rename the file with a date and subject. Separate the original conversation from a revised note when you want both a full record and a concise explanation.
|
|
The images folder is your own filing convention, not a promise that the script downloads remote images. For offline use, check image access, save the assets where permitted, and update Markdown references to local paths. Reopen the note without a connection to identify anything still dependent on the website.
Add a source-conversation link or a brief provenance note to your edited version. Before sharing, remove unrelated private material and check that editing preserved code and mathematical meaning. Export gives you an editable file; organization and verification turn it into a useful reference.
Keep the archive useful
The export code assembles the Markdown in the browser and creates a local download. Image references remain URLs, so the Markdown file alone is not necessarily a self-contained offline archive. Check access and availability before sharing or relying on those images later.
After export, remove sensitive content before publishing and verify that code and formulas still mean what the source conversation meant. For better filenames after saving, see Auto Filename Helper. The source file is the clearest reference for the actual conversion rules.