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.
Download PDF opens your browser's print dialog. Choose Save as PDF as the destination.
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.
| Size | Inches | Millimeters | Used in |
|---|---|---|---|
| Letter | 8.5 × 11 | 216 × 279 | The US, Canada and parts of Latin America |
| A4 | 8.27 × 11.69 | 210 × 297 | Almost everywhere else |
| Legal | 8.5 × 14 | 216 × 356 | Some 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:
| Style | Top | Sides | Bottom |
|---|---|---|---|
| Classic | 1 in (25 mm) | 1.1 in (28 mm) | 0.9 in (23 mm) |
| GitHub | 0.75 in (19 mm) | 0.7 in (18 mm) | 0.75 in (19 mm) |
| Modern | 0.9 in (23 mm) | 1 in (25 mm) | 0.9 in (23 mm) |
| Academic | 1 in (25 mm) | 1.15 in (29 mm) | 1 in (25 mm) |
| Report | 1 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) |
| Worksheet | 0.8 in (20 mm) | 0.9 in (23 mm) | 0.8 in (20 mm) |
| Gothic | 1 in (25 mm) | 1.1 in (28 mm) | 0.9 in (23 mm) |
| Sandwake | 1 in (25 mm) | 0.9 in (23 mm) | 0.9 in (23 mm) |
| Elvish | 1.1 in (28 mm) | 1.25 in (32 mm) | 1 in (25 mm) |
| Cyberpunk | 1 in (25 mm) | 0.75 in (19 mm) | 0.9 in (23 mm) |
| Newspaper | 1 in (25 mm) | 0.75 in (19 mm) | 0.8 in (20 mm) |
| Fiendish | 1 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.
Print settings to leave alone
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:
- Margins: Default. Default uses the style's margins, at the spacing you chose. None, Minimum or Custom replace them, which can put text right up against the edge of the paper and lose the page numbers.
- Scale: 100% or Default. A smaller scale fits more on each page by making all the text smaller than the style intends. If your document is a few lines too long, it's better to edit it, or to set Spacing to Compact.
- Paper size. If the dialog offers a paper size, make sure it matches the one chosen in md2pdf.me.
- Headers and footers: off. Chrome and Edge leave the date and web address off the page automatically. In Safari and Firefox, untick Print headers and footers yourself.
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:
- Pages shows them; the preview doesn't. In Chrome and Edge, turn on Pages above the preview to see the pages in landscape, with your margins. Otherwise the preview stays portrait, with the style's margins at your spacing: check the result in the print dialog's preview after clicking Download PDF. A table that's too wide for the page isn't shrunk to fit on its own, as it is on a normal page; the browser shrinks the whole page instead. Pages doesn't show that: it cuts the table off at the page's edge and says the PDF's pages will break differently, so check those in the print dialog.
- Browsers differ. We've tested these lines in Chrome. Other browsers may handle them differently, so look at the print preview before saving.
Common mistakes
- Switching to Legal for a wide table. Legal is longer, not wider. Use a landscape page, or follow the tips for wide tables.
- Letter for a reader in Europe. It prints fine on A4, but slightly smaller, with uneven white space at the top and bottom. Switch the menu to A4 when you know where it's going.
- Margins set to None. Most printers can't print right up to the edge of the paper, so text near the edge may be cut off when the PDF is printed.
- Fitting a page by scaling it. If a document runs onto one extra page, setting Spacing to Compact or editing a few lines is better than shrinking all of it.
Other how-to guides
- Résumé: a Markdown template that prints on one page
- Troubleshooting: fixes for common problems with the PDF