How to Add a Page Break in Markdown (PDF & Word)
Markdown has no native page break, but you can force page breaks when exporting to PDF or Word. Learn the tricks for clean paginated documents.
Markdown was designed to produce HTML, and HTML has no concept of a "page" — it is a continuous flow of text. Sooner or later, though, everyone who exports Markdown to PDF or Word runs into the same question: how do I force the next section onto a fresh page? The honest answer is that there is no native markdown page break syntax, but there are several reliable tricks that work when you convert Markdown to a paginated format. This tutorial covers the practical options and the trade-offs of each.
Why Markdown Has No Native Page Break
Standard Markdown, GitHub Flavored Markdown, and CommonMark all deliberately ignore pagination. The language compiles to HTML elements like headings, paragraphs, and lists, none of which carry information about pages, paper size, or print layout. A page is a property of the output format (PDF, Word, print), not the source text.
Think of it this way: Markdown describes the structure of your document. Page breaks describe how a specific renderer should slice that structure onto sheets of paper. The two concerns live in different layers.
That separation keeps your source portable — the same .md file can render on a phone screen, a web page, or an A4 printout — but it means page-break control is always a convention layered on top of Markdown, never part of the spec. The table below maps where each convention is honored:
| Technique | Works for PDF | Works for Word .docx | Works in plain HTML |
|---|---|---|---|
--- or *** (horizontal rule) | No (just a line) | No (just a line) | Yes (visual rule) |
| Page-break HTML comment | Depends on converter | Yes, with the right tool | No |
Raw <div style="page-break..."> | Some converters | Some converters | With print CSS |
Pandoc \newpage (LaTeX/Pandoc) | Yes | Yes | No |
| Dividing the source into multiple files | Yes | Yes | n/a |
Add a Page Break in Markdown for PDF Export
When the target is PDF, the cleanest page-break trick depends on which converter you are using. The two most common paths are Pandoc and a browser-based converter.
With Pandoc driving a LaTeX engine, you can drop a raw LaTeX command straight into the Markdown source. Pandoc passes it through and the resulting PDF starts a new page at that point.
# Part One
Body content for the first section.
\newpage
# Part Two
Body content that now begins on a fresh page.
For chapters or major divisions, \newpage is usually enough. If you also want to suppress page numbers or trigger a specific page style, \pagebreak behaves similarly but pushes pending content onto the new page rather than breaking immediately.
Tip: wrap your page-break commands in HTML comments if you want the source to stay readable in tools that do not understand LaTeX.
<!-- \newpage -->keeps the marker visible to Pandoc's filter pipeline while hiding it from casual readers.
If you prefer a browser-based workflow, paste your Markdown into a converter that interprets a recognized break marker (often a horizontal rule followed by a special comment, or a dedicated page-break token) and renders the PDF with that break honored. The Markdown to PDF tool is built for exactly this case.
A reasonable page-break checklist for PDF:
- Decide where each top-level section starts on a new page.
- Use
\newpage(Pandoc) or the converter's documented marker. - Check the rendered PDF — not just the source — to confirm breaks land where you want.
-
Rely on heading levels alone— headings do not imply a page break.
Insert a Page Break When Converting Markdown to Word
Word is friendlier to page breaks than PDF because the .docx format has an explicit page-break element. The challenge is getting your Markdown converter to emit it. The most portable approach is to insert a marker the converter recognizes — commonly a paragraph containing only a recognized page-break token.
A pattern that works across several converters is a horizontal rule on its own line, optionally paired with a comment:
Content above the break.
---
<!-- pagebreak -->
Content below the break.
When you paste Markdown like this into the Markdown to Word converter, a well-built converter will treat the rule-and-comment combination as a hard page break and insert a native Word page break in the .docx. From there, Word users see the same behavior as if they had pressed Cmd/Ctrl + Enter.
For writers who live in Pandoc, the LaTeX command also flows through to Word output:
pandoc input.md -o output.docx
Inside input.md, a \newpage or \pagebreak on its own line is honored by Pandoc's Word writer and becomes a real page break in the .docx. The result is identical to what a human would insert manually inside Word.
Use HTML to Force a Page Break in Markdown
Because Markdown allows inline HTML, you can drop in a <div> or <span> with a page-break-after style. This is the approach most static-site generators and browser-based converters rely on.
First section content.
<div style="page-break-after: always;"></div>
Second section content, now on its own page.
A few cautions worth stating plainly:
-
page-break-after: always;is the most widely supported value. - Some converters prefer
break-after: page;(the modern CSS equivalent). -
Empty— they add a line break, not a page break.<br>tags -
Relying on this inside GitHub's renderer— GitHub strips most inline styles, so the break is invisible there.
If your converter is HTML-aware, this is the most reliable single technique because it does not depend on a specific engine like LaTeX. It also degrades gracefully: tools that ignore the style simply render an empty block, which usually only costs a blank line.
Tips for Clean Pagination When Converting Markdown
Page breaks are only one part of a clean paginated document. A few habits make the difference between a polished export and a messy one.
- Start every major section with a level-one
#heading and put the break before it, so the heading sits at the top of the new page. - Keep tables compact — wide tables often overflow the page width and break layout.
- Avoid
very long single-line paragraphs; they are hard to reflow if the page size changes. - Test the final export at the paper size you actually need (A4 vs. Letter) before sending it out.
- If a section must not split across pages (a table, a code block), keep it small enough to fit on one page.
| Symptom | Likely cause | Fix |
|---|---|---|
| Break lands a line too early | Marker placed on the wrong line | Move the marker above the heading, not after |
| Break is ignored in the output | Converter does not recognize the marker | Switch to \newpage or the HTML <div> form |
| Page numbers reset unexpectedly | Cover page counted as page 1 | Use a tool that supports front-matter separation |
| Wide table overflows the margin | Table wider than the page | Reduce columns or use smaller content |
Conclusion: Control Page Breaks in Markdown Exports
You will not find a ^pagebreak token in the Markdown spec, and that is by design — pagination belongs to the output, not the source. In practice, you have three solid options: a Pandoc \newpage for PDF and Word through Pandoc, an HTML <div style="page-break-after: always;"> block for browser-based converters, or a recognized rule-plus-comment marker in tools that document one. Pick the one your converter supports, place it before the heading that should start the new page, and verify the result. For most writers, the fastest path is to draft in Markdown and then push the file through the Markdown to Word converter to produce a .docx with real, native page breaks — and route the same source through Markdown to PDF when the deliverable is a print-ready document.