Markdown or DOCX to a print-ready paperback interior PDF

KDP Book Interior Formatter

Set a manuscript in a trim size KDP prints, with mirrored margins whose inside edge follows KDP's minimum for the final page count, chapters opening on right-hand pages, running heads and page numbers. The PDF embeds its fonts.

Manuscript

Markdown (# chapter, ## subheading, * * * scene break, > quote), plain text, or .docx with Heading 1 chapters.

Drop a manuscript

DOCX, MD or TXT, up to 50 MB (4 MB of text)

Book details

Front matter pages are built from these; leave a box empty to skip that line.

Rights statement, ISBN, edition. One line per row, up to 1,500 characters.

Page and type

Set in an embedded serif face (Times-compatible).

Multiple of the font size

KDP's minimum for the page count is applied if larger.

Page size is exactly 6 x 9 in with no bleed, which is right for a text-only interior. The fonts are embedded; the text is not hyphenated.

KDP Book Interior Formatter

Operator: Abdulla Al Fahad. How tools are built and checked

A paperback interior is not the manuscript with a different font. Kindle Direct Publishing wants a PDF at the exact trim size, with an inside margin that grows as the book gets thicker, chapters that begin on a right-hand page and fonts that travel inside the file. A word processor will do some of that if you set it up by hand, and then lose it when you add a chapter.

This formatter takes Markdown, plain text or a .docx and sets the whole book in one pass: title page, copyright page, contents, chapters, running heads and page numbers. Because the inside margin depends on the page count and the page count depends on the margin, it lays the book out again until the two agree.

Key features

  • Five trim sizes: 5 x 8, 5.25 x 8, 5.5 x 8.5 and 6 x 9 inches, and A5 (148 x 210 mm), with the PDF page set to exactly that size and no bleed
  • Mirrored margins: the inside margin is the larger of your choice and KDP's minimum for the final page count (0.375 in up to 150 pages, 0.5 in up to 300, 0.625 in up to 500, 0.75 in up to 700 and 0.875 in beyond)
  • Every # chapter opens on a right-hand page, with a blank left-hand page inserted when needed, and the contents page lists the real page numbers
  • Running heads (book title on left-hand pages, chapter title on right-hand pages), centred page numbers starting at 1, and none of either on opening or blank pages
  • Justified text with a baseline grid, first-line indents, optional three-line drop caps, scene breaks and at least two lines of any long paragraph at the foot or head of a page
  • Embedded Times-compatible fonts in four styles, so italics and bold come from the file and not from the printer

How the interior is laid out and which KDP rules set the margins

Markdown headings do the structuring. A line starting # is a chapter, ## and deeper are subheadings, a line of *** or --- or # alone is a scene break, > starts a quote, and - or 1. starts a list. *Italic*, **bold** and ***both*** are kept, links keep their text, and images and tables are counted and left out. A .docx goes through mammoth: Heading 1 becomes a chapter, other headings become subheadings, and the Quote and Block Text styles become quotes.

Pages are laid out on a grid whose line height is the font size times the line spacing, so 11 pt at 1.35 gives 14.85 pt and 36 lines on a 6 x 9 in page with 0.75 in top and bottom margins. Lines are broken greedily and justified by widening the spaces; words are never hyphenated, and a word wider than the whole line is cut at the line width. A paragraph of four lines or more never leaves a single line behind at the bottom or top of a page, and shorter paragraphs move whole.

Fonts are Foxit's metric-compatible serif set that ships with pdf.js, embedded as CFF programs with their own width tables. They cover Western European characters only, so a character outside Windows-1252 is replaced by the nearest plain letter or a question mark, and the page lists which ones. The .docx is checked while it is unpacked, with a cap on the real inflated size, before mammoth reads it, and a package that lists one part twice under names that differ only in capital letters is refused.

How it works

The book is laid out, the final page count is read, and KDP's minimum inside margin for that count is compared with the margin in use. If the minimum is larger, the margin is raised and the book is laid out again, up to six times, and the margin only ever goes up, so the loop stops. The result is padded to an even number of pages and to KDP's 24-page minimum with blank pages at the end.

A chapter opening goes on the next odd-numbered page of the body. If the chapter would start on a left-hand page, that page is left blank and unnumbered, and the chapter starts on the next one.

Common use cases

  • A 90,000-word novel with 28 chapters: every chapter starts on a right-hand page, so some chapters cost an extra blank page, and the page count you see already includes them.
  • A memoir exported from Google Docs as .docx, where chapter titles use Heading 1 and the epigraphs use the Quote style, comes out with the epigraphs indented on both sides and no hand fixing.
  • A short book where you want the tightest legal gutter: lower the inside margin to 0.375 in and it holds up to 150 pages. Past 150 pages the tool raises it to 0.5 in by itself, and the page count it shows is for that wider margin.
  • A 300-page novel at the default 0.5 in inside margin gets one more chapter. At 301 pages KDP's minimum becomes 0.625 in, so the margin widens, the text block narrows and the book is set again, which can add pages of its own.

How to use this tool

  1. Drop a .docx, .md or .txt manuscript, or paste Markdown.
  2. Enter the title, author, year and any copyright lines, then pick the trim size, type size and margins.
  3. Press Build interior PDF and read the page count, the inside margin and the warnings under it.
  4. Page through the spreads, then download the PDF.

Example

Manuscript pasted as Markdown (6 x 9 in, 11 pt, drop caps on; title The Lamp at Harbour Street, author Ada Example, 2026, copyright lines "All rights reserved." and "First edition.")

# The Lamp at Harbour Street

The lamp had been lit every evening for forty years, and on the evening it failed, Mrs Okafor was the first to notice. She stood at her window with a cup gone cold in her hands and counted the houses on the far side of the street: eleven, and not one of them dark.

"It is only the bulb," said her neighbour, who had come across the road in his slippers. *Only the bulb.* She did not answer him.

* * *

By morning the whole street knew. Somebody had left a ladder against the post, and a note beside it: **Do not touch until the council comes.**

# What the Council Said

The council came on Thursday, three people in yellow jackets, and they were kind about it. The post was older than the pavement, one said, and the wiring inside it older still.

## The vote

On Friday night forty-one people stood under the dead lamp and voted by raising their hands.

> The lamp is not the light, it is the habit of looking up.

- Replace the bulb
- Replace the post
- Leave it dark for one winter

Readout under the build button

24 pages: 4 front pages (title, copyright, contents, one blank) and 3 body pages. Chapter 1 'The Lamp at Harbour Street' opens on page 1 and chapter 2 'What the Council Said' on page 3, because page 2 is the blank left-hand page. Inside margin 0.5 in, 36 lines of about 82 characters per page. A warning says 17 blank pages were added at the end: one to make the count even and 16 more to reach KDP's 24-page minimum.

Common pitfalls

There is no bleed, which suits a text-only interior. A book with pictures that run to the page edge needs bleed and a different page size.

Footnotes, tables and images in a .docx are left out and counted above the form. Move footnote text into the body first if the book needs it.

Without hyphenation, narrow trim sizes with a large type size produce loose lines in justified text. Turn justification off or reduce the type size to tighten them.

  • Use # for chapters and ## for parts or sections inside a chapter. A ## heading never forces a new page, so a manuscript with part titles as ## will not gain blank pages.
  • A scene break typed as * * * on its own line prints the mark from the Scene break box, which can be changed to *** or a single #.

Common errors and how to fix them

"The margins leave less than 2 inches for text."
The outside margin plus the gutter is too wide for the trim size. Lower the outside margin or choose a larger trim size.
"This manuscript sets to more than 1500 pages."
The page cap protects the browser tab. Split the book into volumes; KDP's own paperback limit is 828 pages.

Best practices

  • Order a printed proof after the final page count is settled, because adding or cutting a chapter can move the inside margin to the next KDP step and shift every page.

KDP's gutter table in one place

KDP's minimum inside margin for a paperback is 0.375 in for 24 to 150 pages, 0.5 in for 151 to 300, 0.625 in for 301 to 500, 0.75 in for 501 to 700 and 0.875 in for 701 to 828. The outside, top and bottom margins have a lower limit of 0.25 in without bleed; this tool defaults to 0.5 in outside and 0.75 in top and bottom so that running heads and page numbers sit well clear of the edge.

The spine width for the cover comes from the same page count. The readout shows it for black ink on white paper, and the cover template page takes any paper type.

Frequently asked questions

Why did the page count go up when I enlarged the inside margin?

A wider inside margin narrows the text block, so the same words fill more lines and more pages. The tool lays the book out again after each margin change and reports the count for the margin it ended on.

Can I use this for a hardcover or an ebook?

The PDF is a paperback interior with KDP's paperback margins. An ebook is reflowable and is not made from a fixed-size PDF, and a hardcover interior has its own limits, so check those before reusing the file.

How is this different from converting Markdown straight to a PDF?

A general Markdown to PDF page sets one flowing document at one page size. This one adds the pieces a printed book needs: chapters on right-hand pages, mirrored margins, running heads, a page-numbered contents and the page-count rule for the inside margin.