Export Notion Data to Markdown
Updated:
There are three ways to export your Notion workspace data to Markdown:
- Using Notion's built-in export feature
- Using the Notion API
- Using Notion Backups
Notion's built-in export feature
Notion's native export feature, though manual, is the most straightforward way to get your data out of Notion. You can either export a single page or an entire workspace.
To export a single page, click the three-dot menu (•••) in the top-right corner and select "Export". We recommend selecting the "Everything" option in the "Include content" menu and exporting subpages as well.
To export an entire workspace, go to Settings > Workspace (Settings) > Export all workspace content. Select "Everything" to include all your media files. Exporting larger workspaces can take anywhere from a few hours to a few days, and it’s not uncommon for exports to occasionally fail.
Keep in mind that databases will be exported as CSV files (use Excel, Google Sheets, or Numbers for easier viewing).
Notion API
If you have the technical chops, you could automate the export process using third-party libraries.
First, create an internal integration and grab an authentication token.
You can use one of the many third-party packages, such as notion-to-md. Replace the your-token
placeholder with your own authentication token.
Next, replace the target-page-id
with the page ID you want to back up. You can find the page ID from the URL.
const { Client } = require("@notionhq/client");
const { NotionToMarkdown } = require("notion-to-md");
const fs = require('fs');
// or
// import {NotionToMarkdown} from "notion-to-md";
const notion = new Client({
auth: "your-token",
});
const n2m = new NotionToMarkdown({ notionClient: notion });
(async () => {
// page ID goes in here
const mdblocks = await n2m.pageToMarkdown("target-page-id");
const mdString = n2m.toMarkdownString(mdblocks);
console.log(mdString.parent);
})();
Notion Backups
Notion Backups allows you to easily export your Notion data to Markdown and save it in the cloud storage provider of your choice. Unlike Notion's built-in Markdown export, our backups are exclusively in Markdown and contain no CSV files.
Make sure you check the "Back up in Markdown format" option in the workspace settings.
Back up your Notion workspaces today
Get started