How to export Confluence pages to Markdown (one page, a page tree or a space)
Updated 2 December 2026 · 7 min read
Short answer: To export one Confluence Cloud page to Markdown, open More actions (•••), then Export, then Markdown, if your site has Atlassian's native option. It has been rolling out for single pages since mid 2026, and availability varies by site (as of December 2026). For a page tree or a space there is no native Markdown export: fetch page bodies from the REST API and convert them with pandoc, run an open-source exporter, or use a Marketplace app. Folio exports a chosen page tree as one llms-full.md file or a zip of Markdown files with frontmatter and relative links.
Does Confluence Cloud export to Markdown natively?
Partly. As of December 2026, Atlassian's release notes list an entry called "Export pages as markdown files". It is labeled as rolling out from June 2026 and as a beta, and it covers single pages. Atlassian's export documentation for Word, PDF, HTML and XML still lists only Word and PDF for a page and PDF, CSV, HTML or XML for a space, so the menu on your site may not show Markdown yet.
To use the native option on a single page:
- Open the page.
- Select More actions (•••) at the top right.
- Select Export, then Markdown.
- Open the downloaded
.mdfile and check tables, code blocks, panels, links and images against the page.
The release note does not say how tables, macros or images convert, and the option is reported to work on one page at a time. Test on a page that has all of those before you rely on it. If the Markdown entry is missing from your menu, it has not reached your site, and the methods below still work.
Which method fits a page tree or a whole space?
No single method is best. Pick by scope and by how much you want to maintain.
| Method | Best for | Scope | What you maintain |
|---|---|---|---|
| Native Export, Markdown | Occasional copies of single pages | One page | Nothing. Availability varies by site. |
| REST API plus pandoc | Scripted exports by engineers | Any pages you can read | A script, an API token, link and macro cleanup |
| Space export (HTML) plus pandoc | Admins who want to avoid API scripting | Selected pages or a whole space | A conversion step and cleanup; needs space admin permission |
| Open-source exporter | Teams comfortable with Python and API tokens | Page, page with descendants, space | Installation, authentication, fidelity checks |
| Marketplace apps | Admins who want a UI, bulk export or attachments | Varies by app | Review data handling, permissions and Runs on Atlassian status first |
| Folio for Confluence | Page trees for AI tools, or round trips to Git | A chosen page tree | Nothing to script. Confluence Cloud only; images not exported |
Open-source options exist too. confluence-markdown-exporter is an MIT-licensed Python tool that, according to its PyPI page, exports a single page, a page with its descendants, a space or every space in an organization through the Atlassian API. Judge its output on your own pages before you commit to it.
How do you export a page tree with the REST API and pandoc?
Pandoc is a free document converter. The options used here are -f html (read HTML), -t gfm (write GitHub-flavored Markdown) and --wrap=none (do not hard-wrap lines); see the pandoc manual.
Which body to feed it matters. In a test with pandoc 3.9 on a small hand-written sample in storage format, pandoc lost the target of a page link, merged a code macro's language parameter into the code text, flattened an info panel into a plain paragraph, and turned the header row of a table into a body row under an empty header:
<!-- input: storage format sample -->
<p>See <ac:link><ri:page ri:content-title="Rollback" />
<ac:plain-text-link-body><![CDATA[Rollback guide]]></ac:plain-text-link-body></ac:link>.</p>
<ac:structured-macro ac:name="code"><ac:parameter ac:name="language">bash</ac:parameter>
<ac:plain-text-body><![CDATA[make deploy ENV=prod]]></ac:plain-text-body></ac:structured-macro>
<ac:structured-macro ac:name="info"><ac:rich-text-body><p>Freeze window starts Friday.</p></ac:rich-text-body></ac:structured-macro>
<table><tbody><tr><th>Env</th><th>URL</th></tr><tr><td>prod</td><td>https://example.com</td></tr></tbody></table>
The output of pandoc -f html -t gfm --wrap=none was:
See Rollback guide.
bash make deploy ENV=prod
Freeze window starts Friday.
| | |
|------|---------------------|
| Env | URL |
| prod | https://example.com |
Storage format is XML with Confluence-specific elements, so a generic HTML reader does not understand it. The rendered view representation is plain HTML with macros already expanded, which gives pandoc standard elements to work with. Class names and wrappers still vary, so check code blocks, panels and tables on a sample page first.
This example script exports a page and all its descendants. It needs curl, jq, pandoc, your site name, your Atlassian account email and an Atlassian API token for an account that can read the pages. It calls the pages and descendants endpoints of the Confluence REST API v2, and the descendants endpoint returns at most 10 levels per call.
#!/usr/bin/env bash
# Example: export a Confluence Cloud page and its descendants to Markdown.
set -euo pipefail
: "${CONF_SITE:?}" "${CONF_EMAIL:?}" "${CONF_TOKEN:?}" "${ROOT_ID:?}"
api() { curl -fsS -u "$CONF_EMAIL:$CONF_TOKEN" "https://$CONF_SITE$1"; }
mkdir -p out
ids="$ROOT_ID"
next="/wiki/api/v2/pages/$ROOT_ID/descendants?limit=250&depth=10"
while [ -n "$next" ]; do
resp=$(api "$next")
ids+=$'\n'$(jq -r '.results[] | select(.type == "page") | .id' <<<"$resp")
next=$(jq -r '._links.next // empty' <<<"$resp")
done
for id in $ids; do
page=$(api "/wiki/api/v2/pages/$id?body-format=view")
title=$(jq -r '.title' <<<"$page")
{
printf -- '---\ntitle: %s\nconfluence_page_id: "%s"\n---\n\n' "$(jq -Rn --arg t "$title" '$t')" "$id"
jq -r '.body.view.value' <<<"$page" | pandoc -f html -t gfm --wrap=none
} > "out/$id.md"
done
Run it with CONF_SITE=your-site.atlassian.net, CONF_EMAIL, CONF_TOKEN and ROOT_ID set. Files are named by page ID, which avoids duplicate-title and illegal-character problems, and each file gets frontmatter with the title and page ID. Three limits to know:
- Links between pages still point at Confluence URLs, and images are not downloaded.
- Macros come out as whatever HTML they rendered to, which may be nothing.
- Confluence Cloud applies rate limits. If you receive HTTP 429, wait for the
Retry-Afterseconds and retry, as described in Atlassian's rate limiting guide.
How do you export a whole space with Confluence's own HTML export?
Space admins can export a space, or a hand-picked group of pages in it, to HTML. Atlassian describes the HTML export as a zipped archive that leaves out blog posts and page comments, with attachments in folders named after the page ID.
- Next to the space name in the sidebar, select More actions (•••), then Space settings.
- Open General and select Export space.
- Choose HTML and select Next.
- Export everything you can view, or select specific pages, then export.
- Download and unzip the archive, then convert each HTML file:
find export -name '*.html' ! -name 'index.html' -print0 |
while IFS= read -r -d '' f; do
pandoc -f html -t gfm --wrap=none "$f" -o "${f%.html}.md"
done
This path needs no API token and keeps attachments next to the files, but the output is only as clean as the exported HTML. Convert three or four representative pages and read the results before you convert hundreds. Large exports can take a while, and Atlassian suggests exporting smaller subsets if a bulk export fails.
What gets lost when you convert Confluence to Markdown?
Every route loses something, because Markdown has no equivalent for several Confluence features. Plan for these:
- Macros. Panels, expand sections, status lozenges, Jira issue macros and page properties either become plain text, placeholders or nothing.
- Page links. Links keep pointing at Confluence unless you rewrite them to file paths.
- Mentions and dates. User mentions and date lozenges turn into plain text.
- Images and attachments. Only methods that download attachments carry them across.
- Everything outside the body. Labels, comments, ownership and version history are not part of the page body. Carry the ones you need in frontmatter.
A converter that reads Atlassian Document Format (ADF) directly, rather than HTML, can map more of these cleanly, because ADF names each construct. See the ADF guide for the node types.
How does Folio export a page tree to Markdown?
Folio for Confluence reads each page's ADF through the Confluence REST API as you, and converts it to GitHub-flavored Markdown. Open Space apps, then Folio for Confluence, and use the Audit & fix tab to choose a section. Then choose an 8k, 32k or 128k token budget and either download a single llms-full.md, download a nested .zip, or copy the Markdown.
The zip mirrors the page tree. A page with children becomes a folder with a README.md, and a leaf page becomes a file named after its title. For a section called Platform Handbook, the layout looks like this (an example):
README.md
onboarding.md
runbooks/
README.md
deploy.md
rollback.md
Each file starts with YAML frontmatter that carries the Confluence provenance, so the pack can be re-imported or traced back to its source (illustrative values):
---
title: "Rollback"
confluence_page_id: "3572058"
confluence_url: "https://your-site.atlassian.net/wiki/spaces/ENG/pages/3572058/Rollback"
updated_at: "2026-11-20T09:14:00.000Z"
health_score: 92
estimated_tokens: 640
owner: "sre-team"
status: "active"
tags:
- runbook
---
The conversion maps panels to GitHub-style alerts, expand macros to <details> blocks, task lists to checkboxes, tables to GFM tables and code blocks to fenced blocks with their language. Links between pages in the tree are rewritten to relative .md paths in the zip. Table-of-contents and similar decorative macros are skipped, and other macros appear as a short placeholder naming the macro.
The limits are real. Folio works on Confluence Cloud only, exports on demand rather than on a schedule, does not sync changes back from Confluence to Git, and does not export images or attachments. Exports use your own permissions, run inside Atlassian's Forge platform and use no AI credits. The token budget and overflow options are covered in the context window guide, and the full feature list is in the Folio docs.
FAQ
Can I export attachments and images with the Markdown?
Not with the pandoc recipes in this guide, which convert text only. Confluence's HTML space export places attachments in folders named after the page ID, so you can keep them beside the converted files and fix image paths yourself. Folio does not export images or attachments. Some Marketplace apps do, so check each listing.
How do I keep links between exported pages working?
Converted pages still link to Confluence URLs. To make them relative, build a map from page ID to file path (the page ID follows /pages/ in a Confluence Cloud URL) and rewrite the links with a script. Folio does this in its zip export, and uses in-file anchors in llms-full.md.
Can I re-import exported Markdown into Confluence?
Confluence Cloud has no native folder import. Folio's zip export is designed to re-import cleanly through Folio's Import tab, and several Marketplace apps import Markdown as well. Check how any importer handles relative links, frontmatter and duplicate page titles.
Does exporting to Markdown change my Confluence pages?
No. Reading pages through the REST API, exporting a space and converting files with pandoc leave the source pages untouched. Folio's export also only reads pages, using your own Confluence permissions.