---
tags:
  - macOS
  - Tahoe
  - markdown
  - terminal
  - pandoc
  - mdcat
  - cmark
  - wkhtmltopdf
title: Converting Markdown Files with Command-Line Tools on macOS Tahoe
---

# Converting Markdown Files with Command-Line Tools on macOS Tahoe

macOS Tahoe provides several command-line tools for converting Markdown (`.md`) files to other formats, such as HTML or PDF. This guide introduces some common options.

## 1. Pandoc

Pandoc is the "swiss army knife" of document conversion, supporting a vast range of input and output formats.

### Installation

If you don't have Pandoc installed, you can download it from [https://pandoc.org/installing.html](https://pandoc.org/installing.html) or use Homebrew:

```zsh
brew install pandoc
```

### Usage

*   **Markdown to HTML:**

    ```zsh
    pandoc input.md -o output.html
    ```
*   **Markdown to PDF:**

    ```zsh
    pandoc input.md -o output.pdf
    ```

## 2. mdcat

mdcat is useful for displaying Markdown in the terminal with syntax highlighting, but it can also convert to HTML.

### Installation

You can install mdcat using Homebrew:

```zsh
brew install mdcat
```

### Usage
*   **Markdown to HTML:**

    ```zsh
    mdcat input.md > output.html
    ```

## 3. cmark

cmark is CommonMark's reference implementation in C. It's fast and accurate, but it only converts to HTML.

### Usage
*   **Markdown to HTML:**

    ```zsh
    cmark input.md > output.html
    ```

## 4. wkhtmltopdf

wkhtmltopdf is not strictly a Markdown converter; it renders HTML into PDF. Therefore, you typically combine it with Pandoc.

### Installation

You can install wkhtmltopdf using Homebrew:

```zsh
brew install wkhtmltopdf
```

### Usage
*   **Markdown to PDF (using Pandoc and wkhtmltopdf):**

    ```zsh
    pandoc input.md -o output.html
    wkhtmltopdf output.html output.pdf
    ```

## Related Guides
*   [Terminal Basics and Zsh Customization on macOS Tahoe](terminal-zsh.md)
*   [Markdown Editing on macOS Tahoe: .md vs .pages](markdown-editing.md)