Page size and margins

Letter or A4? This guide explains the page sizes md2pdf.me offers, the margins each style uses, the print settings that can undo them, and how to make a landscape page for a wide table.

Markdown
Preview

Letter, A4 and Legal

md2pdf.me makes PDFs in the three paper sizes people print on most. Choose one in the menu next to Download PDF. Your choice is remembered, so you only need to set it once.

SizeInchesMillimetersUsed in
Letter8.5 × 11216 × 279The US, Canada and parts of Latin America
A48.27 × 11.69210 × 297Almost everywhere else
Legal8.5 × 14216 × 356Some legal documents and forms in the US

A4 is a little narrower than Letter and about two-thirds of an inch taller. Legal is the same width as Letter, just longer. That matters for where lines and pages end: switch from Letter to A4 and each line holds slightly less text, while each page holds a few more lines. The preview shows the page at its real width for the size you choose, so you can watch lines rewrap as you switch.

Choosing a page size

Pick the paper your reader will print on. If the document is going to someone in the US or Canada, use Letter; anywhere else, A4. For a document that will only ever be read on screen it makes little difference, so use whichever is usual where you are.

If you don't know, don't worry too much. A printer given the other size usually shrinks the page slightly to fit: an A4 page printed on Letter comes out about 6% smaller, and a Letter page on A4 about 3% smaller. Nothing is cut off, and few readers will notice.

Use Legal only when something asks for it, such as a court filing or a form that has to be on legal paper. Its extra length doesn't help with wide tables, because it isn't any wider than Letter; for those, see landscape pages below.

Margins in each style

Each style sets its own margins, chosen to suit its type and the kind of document it's for. The margins stay the same whichever page size you choose. These are the margins at Default spacing:

StyleTopSidesBottom
Classic1 in (25 mm)1.1 in (28 mm)0.9 in (23 mm)
GitHub0.75 in (19 mm)0.7 in (18 mm)0.75 in (19 mm)
Modern0.9 in (23 mm)1 in (25 mm)0.9 in (23 mm)
Academic1 in (25 mm)1.15 in (29 mm)1 in (25 mm)
Report1 in (25 mm)1 in (25 mm)0.9 in (23 mm)
Résumé0.6 in (15 mm)0.7 in (18 mm)0.6 in (15 mm)
Worksheet0.8 in (20 mm)0.9 in (23 mm)0.8 in (20 mm)
Gothic1 in (25 mm)1.1 in (28 mm)0.9 in (23 mm)
Sandwake1 in (25 mm)0.9 in (23 mm)0.9 in (23 mm)
Elvish1.1 in (28 mm)1.25 in (32 mm)1 in (25 mm)
Cyberpunk1 in (25 mm)0.75 in (19 mm)0.9 in (23 mm)
Newspaper1 in (25 mm)0.75 in (19 mm)0.8 in (20 mm)
Fiendish1 in (25 mm)1.1 in (28 mm)0.95 in (24 mm)

The Spacing menu, after Text, changes the margins together with the line spacing and the gaps between paragraphs and headings. Compact makes every margin a quarter smaller (never below 0.45 in, 11 mm), and Roomy makes them a fifth larger.

Wide margins aren't wasted space. Very long lines are tiring to read, because the eye has to travel a long way back to find the start of the next one, and the wide margins of Classic and Academic keep their lines a comfortable length. The margins also hold the page numbers and, in Report and the themed styles other than Gothic, the document's title, which runs along the top of every page after the first. Résumé has the narrowest margins because a résumé needs to fit a lot on one page, and its short lines of bullet points don't need the same room.

If a document runs a little long, set Spacing to Compact first: it fits more on each page without making the text smaller. To change the margins more than that, try another style: Résumé and GitHub have the narrowest margins, Elvish, Academic and Classic the widest. To compare, switch styles with the Style button and watch the preview. The page breaks guide lists where each style puts its page numbers.

Download PDF opens your browser's print dialog, where you choose Save as PDF. The page size and margins are already set by md2pdf.me, so most of the dialog's other settings are best left as they are:

The print dialog's preview is also the best place to check the result: it shows every page, with the page count, before you save.

Landscape pages and custom margins

The page-size menu always makes portrait pages. For a landscape PDF, such as a wide table, a timeline or a large diagram, add this line anywhere in your Markdown, on a line of its own:

<style>@page { size: Letter landscape; }</style>

Write A4 landscape or Legal landscape for the other sizes. The line is invisible in the PDF, and it overrides the menu, so every page of the document turns sideways. The same kind of line sets your own margins, for example half an inch all round:

<style>@page { margin: 0.5in; }</style>

Margins can also be given in millimeters (12mm), or as top, sides and bottom (0.75in 0.6in 0.8in). Your own margins replace the ones the Spacing menu sets; the line spacing and gaps still follow it, and with Pages off the Preview label stops showing a page count. Two things to know before you rely on these lines:

Common mistakes

Other how-to guides

Back to the Markdown guide