← blog  /  tools

KDP cover size and spine width: the formula, in Python

2026-10-29  ·  8 min read  ·  tools

A KDP paperback cover is one PDF: back, spine and front, with bleed. The formula from KDP's own pages, the two places where those pages disagree, how much room spine text really gets, and a guide PDF in plain Python.

A KDP paperback cover is not a front picture. It is one PDF that wraps the whole book: back cover, spine and front cover side by side, plus a strip of bleed around the outside that the printer cuts off. Its size depends on three things: the trim size, the page count and the paper.

KDP gives the formula on its help pages. We read them on 25 October 2026, and in two small places they disagree with each other. Both are below.

The formula#

KDP paperback cover, in inchestext
spine  = pages x thickness of one page
width  = 0.125 + trim width + spine + trim width + 0.125
height = 0.125 + trim height + 0.125

The 0.125 in (3.2 mm) is the bleed on the top, bottom and outside edges. There is none at the spine, because the spine is in the middle. The thickness of a page depends on the paper:

PaperInches per page
White0.002252
Cream0.0025
Groundwood0.00235
Premium color0.002347
Standard color0.002252

The groundwood figure is only on KDP's Paperback Submission Guidelines page. The page called "Create a Paperback Cover" lists the other four.

A 6 x 9 in book of 120 pages on white paper therefore has a spine of 0.2702 in and needs a cover of 12.5202 x 9.25 in. At 300 dpi that is 3,757 x 2,775 pixels. Round up, never down: 3,756 would be a hair short of the size. In a PDF, where sizes are in points (72 to the inch), the page is 901.457 x 666 points.

Spine text: 79 or 80 pages?#

This is the first place KDP's pages disagree. On the same cover page, a note says the book must have at least 79 pages for spine text, and the spine section says text is printed only on books with more than 79 pages. For Cover Creator, KDP's own cover tool, the minimum is 80. With 80 pages or more, every one of those readings is met, so use 80.

The second, smaller one is the page limit: the trim-size table on the help page we read tops out at 828 pages, while the setting built into KDP's cover calculator allows 830.

Allowed is not the same as readable#

KDP asks for 0.0625 in (1.6 mm) between spine text and each fold, because every book binds a little differently. Take that from both sides of the spine and here is what is left for the letters on white paper, in inches and in points (72 to the inch):

PagesSpineRoomPoints
800.1800.0554.0
1200.2700.14510.5
1670.3760.25118.1
3000.6760.55139.6

At 80 pages KDP will print spine text, but the line can be at most 4 points tall. That is well under the 7-point minimum KDP sets for text inside a book. At 120 pages there is room for 10-point type, and at 167 pages for 18. Below about 100 pages, consider a plain spine in the cover's colour.

What else the cover must leave free#

  • The safe area. Anything that must not be cut off stays at least 0.25 in from the outside edge of the cover file, which is 0.125 in inside the trim line.
  • The folds. KDP allows 0.0625 in of variance on either side of each fold, so a line or a border exactly on the fold may land on the front or the back.
  • The barcode. If you do not supply one, KDP puts its barcode in a white box 2 x 1.2 in in the lower right corner of the back cover and covers whatever is there. If you supply your own, KDP suggests the same 2 x 1.2 in (at least 1.4 x 0.8 in), 100% black on a white background, and at least 0.25 in from the spine and the trim. Books that read right to left are mirrored, and the barcode goes in the lower left.

The code#

cover_size is the formula. guide_pdf writes a one-page PDF at the exact cover size with the trim line, the two folds, a safe area on each cover and the barcode box drawn in. It uses no library: a PDF this simple is four small objects and a table of where each one starts in the file.

KDP cover size, spine text room and a guide PDFpython
SPINE_PER_PAGE = {          # inches of spine per page, from KDP's help pages
    "white": 0.002252, "cream": 0.0025, "groundwood": 0.00235,
    "premium color": 0.002347, "standard color": 0.002252,
}
BLEED = 0.125               # on the top, bottom and outside edges
FOLD = 0.0625               # KDP: keep spine text this far from each fold

def cover_size(trim_w, trim_h, pages, paper="white"):
    """The full wrap (back, spine, front) of a KDP paperback, in inches."""
    spine = pages * SPINE_PER_PAGE[paper]
    return {
        "spine": spine,
        "width": BLEED + trim_w + spine + trim_w + BLEED,
        "height": BLEED + trim_h + BLEED,
        "spine_text": pages >= 80,          # 80 pages satisfies every wording KDP uses
        "spine_text_room": max(0.0, spine - 2 * FOLD),
    }

def guide_pdf(path, trim_w, trim_h, pages, paper="white"):
    """A one-page PDF at the exact cover size: trim, folds, safe areas and KDP's barcode box."""
    c = cover_size(trim_w, trim_h, pages, paper)
    s, x_spine = c["spine"], BLEED + trim_w
    boxes = [  # x, y, width, height in inches from the bottom left; RGB line colour
        (BLEED, BLEED, 2 * trim_w + s, trim_h, "0 0 0"),                          # trim
        (x_spine, BLEED, s, trim_h, "1 0 0"),                                     # the two folds
        (BLEED + 0.125, BLEED + 0.125, trim_w - 0.25, trim_h - 0.25, "0 0 1"),     # safe area, back
        (x_spine + s + 0.125, BLEED + 0.125, trim_w - 0.25, trim_h - 0.25, "0 0 1"),  # safe area, front
        (x_spine - 0.25 - 2, BLEED + 0.25, 2, 1.2, "0.5 0.5 0.5"),                # barcode, 2 x 1.2 in
    ]
    pt = lambda inches: f"{inches * 72:.3f}"                # PDF units are points: 72 to the inch
    ops = "\n".join(f"{rgb} RG {pt(x)} {pt(y)} {pt(w)} {pt(h)} re S" for x, y, w, h, rgb in boxes).encode()
    objs = [b"<< /Type /Catalog /Pages 2 0 R >>",
            b"<< /Type /Pages /Kids [3 0 R] /Count 1 >>",
            f"<< /Type /Page /Parent 2 0 R /MediaBox [0 0 {pt(c['width'])} {pt(c['height'])}] "
            f"/Contents 4 0 R >>".encode(),
            b"<< /Length %d >>\nstream\n%s\nendstream" % (len(ops), ops)]
    out, offsets = bytearray(b"%PDF-1.4\n"), []
    for n, body in enumerate(objs, 1):
        offsets.append(len(out))
        out += b"%d 0 obj\n%s\nendobj\n" % (n, body)
    xref = len(out)
    out += b"xref\n0 %d\n0000000000 65535 f \n" % (len(objs) + 1)
    out += b"".join(b"%010d 00000 n \n" % o for o in offsets)
    out += b"trailer\n<< /Size %d /Root 1 0 R >>\nstartxref\n%d\n%%%%EOF\n" % (len(objs) + 1, xref)
    with open(path, "wb") as f:
        f.write(out)
    return c
Run itpython
c = cover_size(6, 9, 120, "white")
print(f'spine {c["spine"]:.4f} in, cover {c["width"]:.4f} x {c["height"]:.4f} in')
print("at 300 dpi:", math.ceil(c["width"] * 300), "x", math.ceil(c["height"] * 300), "px")
for pages in (79, 80, 120, 167, 300):
    room = cover_size(6, 9, pages)["spine_text_room"]
    print(pages, "pages: spine text", cover_size(6, 9, pages)["spine_text"], f"room {room:.3f} in = {room * 72:.1f} pt")
guide_pdf("cover-guide-6x9-120.pdf", 6, 9, 120)

On 25 October 2026 that printed:

Outputtext
spine 0.2702 in, cover 12.5202 x 9.2500 in
at 300 dpi: 3757 x 2775 px
79 pages: spine text False room 0.053 in = 3.8 pt
80 pages: spine text True room 0.055 in = 4.0 pt
120 pages: spine text True room 0.145 in = 10.5 pt
167 pages: spine text True room 0.251 in = 18.1 pt
300 pages: spine text True room 0.551 in = 39.6 pt

pdfinfo reports the guide at 901.457 x 666 points, the size above. We also checked cover_size against the table in our cover calculator, which is separate code, for all 16 standard trim sizes KDP's calculator lists, at 120 white pages: all 16 agree to a thousandth of an inch.

The guide's safe area keeps 0.125 in from the fold as well as from the trim. That is more than KDP's 0.0625 in of fold variance, on purpose: text that sits right at the allowed limit is the first thing to look wrong when a book binds a little off.

Without the code#

Our KDP cover size calculator does the same for every standard trim size and paper. It gives the spine and the full cover in inches, millimeters and pixels, the margins, and a PDF guide with the folds, safe areas and barcode box drawn in. No sign-up, up to 20 a day. If you are making a puzzle book, our book maker makes the interior and a full wrap cover to these sizes, and checks both against KDP's specs before you download them. And if a book has already been sent back, why KDP rejects puzzle books lists the usual reasons.

written