Markdown を PDF に変換する:最速の方法(と他の方法)
PDF が欲しいだけなら、/markdown-to-pdf を開いて Markdown を貼り付け、PDF をクリックするだけです。出力は見出し、コードハイライト、表、数式、Mermaid 図表をそのまま保持します。インストール不要、テンプレート設定不要、コマンドライン不要 — どのブラウザでも動きます。
これが最速の経路です。本記事の残りでは、なぜ Markdown → PDF が必要なのか、出力に何が含まれるのか、他の 4 つの一般的な方法(Pandoc、VSCode プラグイン、ブラウザ印刷、CLI)が実際にどこで適しているかを説明します。
Markdown は書き手やレビュワーに優しい — Git に向き、ノイズの少ない文法、差分が見やすい。しかしドキュメントがエンジニアの輪を出ると、読者が変わります:
- 意思決定者はレイアウトの安定性を求める。 VS Code で見える Markdown は、Notion やチャットに貼ると違って見えます。PDF はレイアウトを固定するので、承認時のページ番号がマシン間でずれません。
- コンプライアンスや調達はタイムスタンプを欲しがる。 多くの監査ワークフローでは日付入り PDF が必須です。あればチケットや調達書類、取締役会資料に説明なしで添付できます。
- 印刷とオフラインのレビュワーは存在する。 驚くほど多くの顧客、法務、運用担当者が紙に注釈を書きます。PDF はその共通言語です。
- モバイル共有。 PDF は iOS / Android のビュワーでネイティブに開け、Markdown プラグインは要りません。
リリースノート、SLA、RFP 回答、顧客向けレポートを納品するなら、納品物は通常 Markdown ソースではなく PDF です。
当サイトの Markdown PDF 変換ツール は実際の headless Chromium エンジンを使うので、プレビューがそのまま PDF になります:
.mdファイルを貼り付けまたはドロップ。 ドラッグ&ドロップ対応、1 ファイル 1 MB まで。- 右パネルでテーマ、フォント、幅を調整。 ライト・ダーク両テーマで出力可能。印刷想定なら A4 に近い幅を選びます。
- PDF をクリック。 ファイルがダウンロードされます。無料出力には透かしが入り、ログイン済み無料ユーザーには現在、透かしなし出力が合計 5 回提供されます。
自動的に保持されるもの:
- 見出し、リスト、表、引用、リンク
- 一般的な言語のシンタックスハイライト付きコードブロック
- インライン
codeとインデントコード - 埋め込み画像(data URI とリモート URL の両方)
- KaTeX 数式:
$$\int_0^1 x^2\,dx$$が組版された数式として描画 - Mermaid 図表:
```mermaidblocks render as SVG inside the PDF - Task lists (
- [x]/- [ ])
| Method | Best fit | Main tradeoff |
|---|---|---|
/markdown-to-pdf | One-off documents with code, math, and diagrams | 1 MB input; free output rules apply |
| Pandoc | Citations, books, controlled templates | Requires a PDF engine and template work |
| VS Code Markdown PDF | Exporting from the editor | Rendering depends on extension settings |
| Browser print | A page already rendered correctly | Print CSS and page breaks vary |
md-to-pdf | Scripts and CI | Requires Node.js and a browser runtime |
Use the five-method comparison when you need a deeper tool choice. Avoid deciding from claimed install sizes or stopwatch figures: both change with platform, cache, and release.
- Keep tables narrow enough for the chosen paper size.
- Use high-resolution raster images or SVG for printed output.
- Replace fragile relative image paths or configure the renderer's resource path.
- Test one KaTeX block and one Mermaid diagram before exporting a long document.
- Inspect the downloaded PDF for page breaks, clipped code, missing fonts, and link targets.
For syntax colors, use the current option for each tool. Pandoc documents --syntax-highlighting; VS Code Markdown PDF uses markdown-pdf.highlightStyle; md-to-pdf uses --highlight-style. See the code-highlighting guide.
The current hosted converter accepts up to 1 MB of Markdown input and renders PDF with server-side Chromium. It supports code highlighting, KaTeX, Mermaid, tables, images, and task lists. Free PDF output includes a watermark; signed-in free users currently receive five watermark-free exports in total.
Server-side rendering means sensitive files leave the local browser for processing. Review the live privacy and retention terms before submitting confidential material.
Can I use it without installing software? Yes. The hosted path only needs a browser.
Can I combine several Markdown files? The web flow is single-file. For repeatable N-to-N or N-to-one jobs, use the batch conversion guide.
Will code, math, and Mermaid survive? They are supported, but always test your exact theme, fonts, remote images, and diagram syntax.
Use the web converter for an occasional document, Pandoc for citation-heavy publishing, VS Code for editor-centric export, and md-to-pdf for automation. The best method is the one you can reproduce and verify, not the one with the most aggressive speed claim.
Use this small fixture before exporting a long document:
# Export check
- [x] Task list
- [ ] Second item
| Feature | Status |
|---|---|
| Code | Ready |
| Math | Test |
上記の制限とコマンドは、次の最新一次資料で確認しました:
MarkdownToImage を開いて Markdown を描画し、用途に合う形式を選びます。バッチ自動化の前に代表的な文書 1 件で検証してください。