Cheat sheet

Markdown syntax guide

A practical glossary of Markdown how-tos — from links and headings to tables and code blocks — with a quick-reference cheat sheet, editable examples, and live previews you can play with.

Quick reference

One-glance Markdown syntax — copy a snippet, or click an element for a live how-to.

ElementSyntaxCopy
Heading# H1 ## H2 ### H3
Bold**bold**
Italic*italic*
Strikethrough~~text~~
Inline code`code`
Link[text](https://url)
Image![alt](image.png)
Bullet list- item
Numbered list1. item
Task list- [ ] todo
Blockquote> quote
Code block```js code ```
Table| A | B |
Horizontal rule---

Basics

Structure your document with headings, paragraphs, and line breaks.

How to add a heading in Markdown

Use one to six hash symbols (#) at the start of a line. More hashes mean a smaller heading.

Markdown — edit me
Live preview

Project overview

Goals

  • Leave a blank line before and after headings for the most reliable rendering.
  • Use a single H1 for the document title when exporting to PDF.

How to write paragraphs in Markdown

Write plain text. Separate paragraphs with a blank line.

Markdown — edit me
Live preview

Markdown is a lightweight markup language.

It turns plain text into formatted documents.

  • A single line break inside a paragraph is usually ignored unless you enable hard breaks.

How to add a line break in Markdown

End a line with two spaces, or use a blank line for a new paragraph. Some editors also support a trailing backslash.

Markdown — edit me
Live preview

Address line 1
Address line 2
City, Country

  • Two trailing spaces can be hard to see — prefer a blank line when a new paragraph works.

Text formatting

Emphasize words with bold, italic, strikethrough, and inline code.

How to make text bold in Markdown

Wrap text in double asterisks (**) or double underscores (__).

Markdown — edit me
Live preview

Export a print-ready PDF from your Markdown.

  • Asterisks are the most common convention in GitHub-flavored Markdown.

How to italicize text in Markdown

Wrap text in a single asterisk (*) or underscore (_).

Markdown — edit me
Live preview

Use emphasis sparingly for clarity.

How to make text bold and italic in Markdown

Combine three asterisks (or underscores) around the text.

Markdown — edit me
Live preview

This tip is especially important for headings in PDFs.

How to strikethrough text in Markdown

Wrap text in double tildes (~~). Supported in GitHub-flavored Markdown.

Markdown — edit me
Live preview

Price: $49 $29

How to write inline code in Markdown

Wrap short code or commands in backticks (`).

Markdown — edit me
Live preview

Run marked to convert Markdown to HTML.

  • For a literal backtick inside inline code, use double backticks as the wrapper.

How to combine Markdown formats

Nest formatting carefully: put emphasis inside link text, keep code spans tight, and add optional titles to links and images.

Markdown — edit me
Live preview

Try the Markdown to PDF converter.

  • Run npm install then export
  • Prefer clear over noisy emphasis

Logo

  • Put formatting markers inside the link brackets: [**text**](url), not **[text](url)**.
  • Image titles go in quotes after the URL inside the parentheses.

Lists

Create bullets, numbered lists, nested items, and task checklists.

How to create a bullet list in Markdown

Start each line with -, *, or + followed by a space.

Markdown — edit me
Live preview
  • Convert Markdown
  • Preview live
  • Download PDF
  • Stick to one bullet character style within a list for consistency.

How to create a numbered list in Markdown

Start each line with a number and a period. Many renderers renumber automatically.

Markdown — edit me
Live preview
  1. Write your Markdown
  2. Adjust the theme
  3. Export the PDF
  • You can write 1. on every line; GitHub-flavored Markdown still renders 1, 2, 3.

How to nest lists in Markdown

Indent nested items with two or four spaces (or a tab).

Markdown — edit me
Live preview
  • Features
    • Live preview
    • Custom themes
  • Export options

How to create a checklist in Markdown

Use - [ ] for unchecked and - [x] for checked items (GitHub-flavored Markdown).

Markdown — edit me
Live preview
  • Draft the README
  • Add screenshots
  • Publish the release
  • Task lists are great for meeting notes and project plans before you export to PDF.

Quotes, code & rules

Call out quotes, share code blocks, and separate sections.

How to add a blockquote in Markdown

Start the line with >. Nest quotes by stacking > characters.

Markdown — edit me
Live preview

Markdown is intended to be as easy-to-read and easy-to-write as possible.

How to nest blockquotes in Markdown

Stack > characters for nested quotes, and use a blank > line between paragraphs inside a quote.

Markdown — edit me
Live preview

Design docs should be easy to skim.

And quotes help call out decisions.

Keep them short in PDFs.

  • A lone > on a line creates a paragraph break inside the quote.

How to add a code block in Markdown

Wrap code in triple backticks. Add a language name for syntax highlighting.

Markdown — edit me
Live preview
echo 'Hello, Markdown';
  • Indent with four spaces as an alternative to fenced blocks.

How to add syntax highlighting in Markdown

Put a language tag immediately after the opening fence so highlighters can color the code in preview and PDF.

Markdown — edit me
Live preview
const title = 'Markdown to PDF';
console.log(title.toUpperCase());
  • Common language tags: js, ts, php, python, bash, json, markdown, html, css.
  • Without a language tag, the block still renders as code — just without colors.

How to add a horizontal line in Markdown

Use three or more hyphens, asterisks, or underscores on a line by themselves.

Markdown — edit me
Live preview

Section one


Section two

  • Put blank lines around the rule so it is not parsed as a heading underline.

Tables

Build simple tables with pipes and hyphens.

How to create a table in Markdown

Separate columns with | and add a header row followed by a dash row.

Markdown — edit me
Live preview
Syntax Result
**bold** bold
*italic* italic
  • Keep tables simple — complex layouts belong in HTML or a design tool.

How to align table columns in Markdown

Control column alignment with colons in the separator row: left, center, or right.

Markdown — edit me
Live preview
Feature Status Count
Links Yes 12
Tables Yes 3
  • `:---` left-aligns, `:---:` centers, and `---:` right-aligns.
  • Alignment is especially useful for numeric columns in PDFs.

Advanced

Build outlines, escape characters, and mix in HTML when you need more control.

How to create a table of contents in Markdown

List links that jump to headings. Many renderers turn heading text into URL-friendly anchors automatically.

Markdown — edit me
Live preview

Contents

Overview

Write your document in Markdown.

Export

Download a polished PDF when you are ready.

  • Anchor slugs are usually lowercase with hyphens instead of spaces.
  • This converter does not auto-generate a TOC — a manual list like this works in preview and PDF.

How to escape Markdown characters

Prefix a special character with a backslash so it renders literally.

Markdown — edit me
Live preview

Show a literal asterisk: *star* and a literal backtick: `code`.

  • Useful for writing about Markdown itself without triggering formatting.

How to use HTML in Markdown

Most Markdown processors allow inline HTML for tags Markdown cannot express.

Markdown — edit me
Live preview

Version 2nd edition — Ctrl + P to print.

  • Prefer native Markdown when possible; HTML can behave differently across PDF engines.

How to add a comment in Markdown

Markdown has no official comments, but HTML comments are widely supported and hidden from the rendered output.

Markdown — edit me
Live preview

Visible text.

More visible text.

  • Comments are useful for editor notes that should not appear in the exported PDF.

Common Markdown mistakes

Quick fixes for the issues that trip people up most often when writing Markdown for PDF.

My list or code block looks wrong +

Leave a blank line before and after lists and fenced code blocks. Without that breathing room, many parsers merge them into the previous paragraph.

Nested list items will not nest +

Indent child items with a consistent 2 or 4 spaces. Mixing tabs and spaces, or indenting only one space, often breaks nesting.

Line breaks are not showing up +

A single Enter usually continues the same paragraph. End a line with two spaces for a hard break, or use a blank line for a new paragraph. Trailing spaces are easy to miss.

My code fence never closes +

Opening ``` must be matched by a closing ``` on its own line. Add a language tag on the opening fence (like ```js) when you want syntax highlighting.

Images break when I share the document +

Relative paths only work if the image is available at that path for the reader. Prefer absolute HTTPS URLs for shared docs and PDF exports.

Ready to turn Markdown into a PDF?

Paste your Markdown into the live editor, preview the result, and download a polished PDF — free to try, with themes and workspace saving when you sign up.