Skip to main content

Overview

Enhanced markdown (also called “Notion-flavored Markdown”) is an extended Markdown format that supports all Notion block and rich text types. It is used by the markdown content endpoints: POST /v1/pages (via the markdown body param), GET /v1/pages/:page_id/markdown, and PATCH /v1/pages/:page_id/markdown. This format extends standard Markdown with XML-like tags and attribute lists to represent Notion-specific features such as callouts, toggles, columns, mentions, and block-level colors.

Indentation

Use tabs for indentation. Child blocks are indented one tab deeper than their parent.

Escaping

Use backslashes to escape special characters. The following characters should be escaped outside of code blocks: \ * ~ ` $ [ ] < > { } | ^ Do not escape characters inside code blocks. Code block content is literal.

Block types

Text

Headings

Headings do not support children. Headings 5 and 6 are converted to heading 4.

Lists

List items should contain inline rich text. Other block types render as children of an empty list item.

To-do

Quote

For multi-line quotes, use <br> tags within a single > line:
Multiple > lines render as separate quote blocks, not a single multi-line quote.

Toggle

Toggle headings use the {toggle="true"} attribute:

Callout

Callouts can contain multiple blocks and nested children, not just inline rich text. Each child block should be indented.

Code

Do not escape special characters inside code blocks. Set the language if known. Use ```mermaid for Mermaid diagrams.

Equation

Table

All attributes are optional (default to false). Color precedence from highest to lowest: cell, row, column. Table cells can only contain rich text.

Divider

Empty line

Must be on its own line. Plain empty lines are stripped out.

Columns

Media blocks

Page and database references

Table of contents

Synced block

Rich text formatting

Mentions

Self-closing format is also supported: <mention-user url="URL"/>.

Custom emoji

Citations

Colors

Text colors

gray, brown, orange, yellow, green, blue, purple, pink, red

Background colors

gray_bg, brown_bg, orange_bg, yellow_bg, green_bg, blue_bg, purple_bg, pink_bg, red_bg

Usage

  • Block colors: Add {color="Color"} attribute to the first line of any block.
  • Inline text colors: Use <span color="Color">Rich text</span>.

Complete example

A Notion page with a heading, a callout, a to-do list, and a code block renders as: