# Turn Markdown into a PDF

> Turn Markdown into a clean, styled PDF or image with one API request. Headings, lists, tables and code are laid out for you. For notes, docs and reports.

To turn Markdown into a PDF, send the text to CurlShot in the markdown field of a POST request with format=pdf. It is rendered as a clean, styled page, with headings, lists, tables, links and code blocks laid out for reading, and comes back as a PDF. Leave format out to get an image of the same page instead.

Page for people: https://curlshot.com/tools/markdown-to-pdf

## Steps

1. Write the document in Markdown, or take the text your app already has.
2. Send it in a POST request in the markdown field, with format set to pdf.
3. Save the PDF that comes back.

## What people use it for

- Notes, READMEs and changelogs as a PDF to send
- Reports written by a script or an AI assistant, as a document
- Release notes as an image for a post
- Meeting notes and summaries people can print

## The same thing with the API

```bash
curl -X POST "https://curlshot.com/api/v1/screenshot" \
  -H "X-Access-Key: YOUR_ACCESS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"markdown":"# Weekly report\n\n- Visits: 1,204\n- Signups: 38","format":"pdf"}' \
  --output report.pdf
```

An access key is free: https://curlshot.com/register. Read more:

- [HTML and Markdown input](https://curlshot.com/docs/html-and-markdown.md)
- [PDF options](https://curlshot.com/docs/pdf.md)

## Questions

### How do I convert Markdown to PDF?

Send the Markdown to CurlShot in the markdown field of a POST request and add format=pdf. The answer is the PDF file.

### Can I change how it looks?

Yes. The styles option adds your own CSS to the page, so fonts, colors and spacing can match your brand.

### Can I get an image instead of a PDF?

Yes. Leave format out for a PNG, or ask for jpeg or webp. Set viewport_width to choose how wide the page is.

### Are tables and code blocks supported?

Yes. Tables, fenced code blocks, lists, links, quotes and images are all rendered.

## Related

- [Screenshot API](https://curlshot.com/tools/screenshot-api.md): A screenshot API for developers. One HTTP request turns a URL, HTML or Markdown into a PNG, JPEG, WebP or PDF. Full page, devices, blocking, cache, MCP.
- [HTML to image](https://curlshot.com/tools/html-to-image.md): Render your own HTML, CSS or Markdown into an image or a PDF with one API request. For social cards, certificates, receipts and reports.
- [HTML to PDF](https://curlshot.com/tools/html-to-pdf.md): Convert your own HTML and CSS into a PDF with one API request. Paper size, margins, landscape and backgrounds are options. For invoices and reports.
