How to export Markdown from Notion, from page downloads to API access

Notion's built-in export suits quick, one-off page downloads. Markdown files can be opened as plain text. The downloaded archive can also hold images from your pages.1, 2
Export a single Notion page
Open the page and click the three dots at the top right. Select Export, then choose Markdown & CSV from the format menu.1, 2
Click Export to download a zip with Markdown and CSV files. Name the file and choose where to save it.2
Switch on Include subpages to export child pages too. Each child page is saved as a separate file inside the zip.2
The Include content option lets you export everything or leave out files and images. Leaving them out makes the download smaller, but makes it less complete as an archive.3
On mobile, tap the three dots, scroll down and tap Export. Choose Markdown & CSV, then tap Export to open your device's share menu.2
Use AirDrop to send the file to a nearby Mac. You can also paste the download link into your browser or save it in your notes. Notion also sends an email with a link to download the file.2
Export a whole Notion workspace
Open Settings in the sidebar. Under Workspace, select General, then Export all workspace content.2
A workspace export can contain Markdown pages, database CSV files and uploaded files. Workspace exports are available on desktop and the web only.2, 3
The export includes only pages that the person running it can access. Other members' private pages are left out if that person cannot access them.2
Teamspace settings may also keep some content out of the export. On the Enterprise plan, workspace admins can use content search to grant access to specific pages for future exports.2
A workspace export can take up to 30 hours to build. The emailed download link expires after seven days.3
If email alerts are switched off, the link goes to your in-app inbox instead. The export is an archive, not a restore point that can instantly rebuild your workspace.3
If long file paths stop Windows from opening the zip, turn off Create folders for subpages when exporting. This keeps pages and files in one folder, with shorter paths. Another option is to extract the archive with 7-Zip.2
What changes in a Markdown export?
Notion databases export as separate CSV files, not inline Markdown tables. The Markdown page links to the database's CSV file.1, 4
Full-page databases export as CSV, with Markdown files for each subpage. This can be a poor fit for code-based docs that need tables within the text.2, 4
Callout blocks have no direct Markdown equivalent.2, 4 Internal page links export as full Notion URLs. They are not relative links between the exported files, and break when content moves outside Notion.4
Markdown exports do not include page or block comments. Only HTML exports include them, whether resolved or unresolved.3
Export Markdown through the API
Notion's Markdown Content API can fetch a page's full content in one call. Use pages.retrieveMarkdown to retrieve the content as an Enhanced Markdown string.1
This endpoint is restricted to public integrations. Enhanced Markdown includes XML-like tags for features such as callouts and columns.1
The open-source Node.js library notion-to-md offers another route, including for internal integrations. It converts pages, blocks and nested blocks into Markdown.1, 5
Create an integration and get its token before using the library. Use pageToMarkdown, then toMarkdownString.5
Set separateChildPage to true to keep child content separate from the parent in the returned object. Set parseChildPages to false to skip child page parsing.5
Plain text is written as-is by default, so some characters can become Markdown formatting. Set escapeMarkdown to true to escape those characters in non-code text.5
Custom scripts need to handle rate limits, pagination and page access. Each workspace needs its own integration token.6
The blocks endpoint helps with nested content, but each block type needs its own handling. Include error handling for pages that become locked out after access changes.6
Convert HTML or CSV into Markdown
If the native Markdown format does not suit complex content, export the page as HTML instead. Extract the downloaded zip to find the .html file.1
Upload that HTML file to a dedicated HTML to Markdown converter. Download the Markdown file and review it.1
Clean Markdown keeps headings, lists and tables in a form AI systems can read. This reduces token use compared with raw data or complex JSON objects.1
Raw Notion exports can lead to poor retrieval and made-up AI answers. Clean structure matters when preparing documents for systems that retrieve text to support AI answers.1
For a database, export the data as CSV first. A CSV to Markdown converter can then turn the data into a Markdown table.1
Store private Markdown notes with SimplyBoard
Each SimplyBoard entry supports plain text or Markdown, with no rigid templates.7 SimplyBoard encrypts entry content with AES-256-GCM before it leaves your device. Its servers store only encrypted content and cannot decrypt your notes.8
The server does not hold your plain-text vault key. Protect your devices and recovery code, since an unlocked session can expose readable content.8
SimplyBoard offers full-text fuzzy search across entries, including matches when you make typos. Separate encrypted workspaces keep work, personal projects and side ventures apart.7
SimplyBoard offers full offline access to read and write notes. Changes sync in the background when you reconnect, and encrypted entries sync across devices.7, 9
Sources
Frequently asked questions
- Does a Notion Markdown export include page comments?
- No, Markdown exports leave out page and block comments. Only HTML exports include resolved and unresolved comments.
- What should you do if the exported ZIP file cannot be extracted due to long file paths?
- Turn off Create folders for subpages when exporting to keep files in one folder with shorter paths. Alternatively, use 7-Zip to extract the archive.
- How can developers retrieve page Markdown directly through Notion's API?
- Use pages.retrieveMarkdown in Notion's Markdown Content API to retrieve a page as Enhanced Markdown. The endpoint is restricted to public integrations and includes XML-like tags for callouts and columns.
Start writing with true privacy
Get Started Free


