---
title: Markdown
description: Convert HTML to Markdown, or Markdown to HTML
---

Convert HTML to Markdown, or Markdown to HTML.

## Try it

## What it does

**HTML to Markdown** turns a web page's markup into clean Markdown. It keeps headings, bold, italic and strikethrough, code, links, images, lists (including nested ones), quotes and tables. Scripts, styles and the page head are dropped.

**Markdown to HTML** turns Markdown (GitHub style, with tables) into HTML. Anything unsafe, such as scripts, is removed from the result.

The node runs once per incoming item and adds the converted text to it. Content of up to about 2 MB is accepted.

## When to use it

* Before an AI node: raw HTML wastes a lot of the model's budget on tags. Markdown keeps the structure the model needs at a fraction of the size.
* Save a web page as readable notes, for example in a [Notion](/nodes/builtin/integration/notion/) page.
* Turn an AI answer written in Markdown into HTML for an email or a web page.
* To pick out specific values rather than convert the whole page, use [HTML Extract](/nodes/builtin/datatransformation/html-extract/) instead.

## Inputs and settings

Give the content one of two ways: an expression in **Content**, such as `{{ $input.data }}`, or a field name in **Source Field**, such as `data`. **Content** wins when both are filled. **Source Field** accepts dots for nested fields.

**Keep Links**, **Keep Images** and **Keep Tables** only affect HTML to Markdown. Turning **Keep Images** off is a good way to shrink text for an AI node.

## Outputs

Each item comes out with the converted text in **Put Result In Field** (`result` by default). With **Include Input Fields** off, the item holds only that field. Read it downstream with `{{ $input.result }}`.

## Dependencies and credentials

None. This node needs no connection and has no slots for other nodes.

## Example workflow

1. [Get HTML from Link](/nodes/builtin/core/gethtmlfromlink/) fetches an article page.
2. **Markdown** with **Operation** *HTML to Markdown*, **Source Field** set to the field that holds the HTML, and **Keep Images** off.
3. [Summarization](/nodes/builtin/ai/aiagents/summarizationchainnode/) with **Text** `{{ $input.result }}`.

## Common issues

* **"No content to convert. Fill in the Content field, or name the field holding it."** Both **Content** and **Source Field** are empty. Fill in one of them.
* **"Field "..." does not exist on the incoming item."** **Source Field** names a field the item does not have. Check the spelling against the previous node's output.
* **"Input is ... bytes, larger than the 2000000-byte limit this node will parse."** The content is over about 2 MB. Extract the part you need first with [HTML Extract](/nodes/builtin/datatransformation/html-extract/).
* **The Markdown is mostly menus and footers.** The node converts the whole page. Narrow it first with HTML Extract (**Return** *HTML*) on the main content, for example `article`.

## Recipes with this node

## Related nodes

* [HTML Extract](/nodes/builtin/datatransformation/html-extract/): pick values or a section out of HTML.
* [Get HTML from Link](/nodes/builtin/core/gethtmlfromlink/): fetch a page's HTML.
* [Text / Formatter](/nodes/builtin/datatransformation/text-formatter/): other text clean-ups.