---
title: "HTML to Markdown Converter: Free Online Tool | Encited"
url: https://encited.com/free-tools/html-to-markdown
description: "Convert HTML to Markdown online. Paste HTML or enter a URL, render JavaScript pages, and copy or download clean Markdown with tables and code blocks. Free."
lang: en
---

HTML to Markdown

# HTML to Markdown converter

Paste HTML or enter a URL and get clean Markdown, with headings, links, lists, tables and code blocks. Pasted HTML is converted in your browser.

HTML 354 B

Markdown 237 B

Smaller by 33%

Markdown size approximate 60 tokens

## Markdown

\# Trail Runner 2

A lightweight trail shoe for runners with **wide feet**.

- 5 mm lugs for grip on wet rock
- Rock plate under the forefoot

| Size | Weight |
| --- | --- |
| EU 42 | 270 g |

[Size guide](https://example.com/size-guide)

## How to convert HTML to Markdown

1. ### Paste HTML or enter a URL
   Paste a snippet or a whole page, or enter a URL to convert a live page.
2. ### Read the Markdown
   Pasted HTML converts as you type, in your browser. A URL is fetched first, then converted.
3. ### Render JavaScript pages
   For a page built by JavaScript, press Render the page first to convert the content a browser sees.
4. ### Copy or download
   Copy the Markdown or download it as a .md file.

## How HTML elements map to Markdown

Headings

<h1> to <h6> become # to ###### headings.

Emphasis

<strong> and <b> become **bold**, and <em> and <i> become _italic_.

Links and images

<a href> becomes [text](url) and <img> becomes ![alt](src).

Lists

<ul> and <ol> become - and 1. lists, with nested lists indented.

Tables

<table> becomes a GitHub-flavored pipe table, with the first row as the header.

Code

<pre><code> becomes a fenced code block, and inline <code> becomes `code`.

Removed

Scripts, styles, iframes and the page head are dropped. For a whole page, only the <main> or <article> element is converted when the page has one.

## Markdown for AI agents

The As AI agents get it view shows the format Encited serves to AI agents. It differs from standard Markdown in four ways:

Page chrome removed

Navigation, forms, buttons, dialogs and the site header and footer are dropped, so only the page's content is left.

Readable links

Links are written as text (url), and a list of links as text: url, which a model reads without Markdown syntax.

A header block

The page's title, URL, description and language at the top.

Structured data

The page's JSON-LD at the end, so prices, ratings and stock stay attached.

## Convert HTML to Markdown in JavaScript or Python

JavaScript (Turndown)

import TurndownService from "turndown";

const turndown = new TurndownService({ headingStyle: "atx", codeBlockStyle: "fenced" });
const markdown = turndown.turndown("<h1>Hello</h1><p>World</p>");

Python (markdownify)

\# pip install markdownify
from markdownify import markdownify

markdown = markdownify("<h1>Hello</h1><p>World</p>", heading_style="ATX")

## HTML to Markdown FAQ

### How do I convert a webpage to Markdown?

Open the From a URL tab and enter the page's address. The tool fetches the HTML and converts it. If the page builds its content with JavaScript, press Render the page first.

### Is my HTML processed in the browser?

Pasted HTML is converted in your browser and isn't sent anywhere. A URL is fetched by our server, because browsers can't read other sites' HTML directly, then converted.

### Which Markdown flavor does it produce?

The Standard view gives CommonMark with GitHub-flavored tables: ATX headings (#), fenced code blocks, - for list items, [text](url) links and pipe tables. The As AI agents get it view gives the format Encited serves to AI agents.

### How are tables and nested lists converted?

Tables become pipe tables with the first row as the header. Nested lists keep their nesting with indentation.

### Is there an API or library for HTML to Markdown?

In JavaScript, Turndown is a widely used library, and this tool is built on it. In Python, markdownify does the same job. The examples above show both.

### Can I put HTML in Markdown?

Most Markdown renderers, including GitHub's, pass raw HTML through. Converting to Markdown removes it, which is why the output is smaller and easier for an AI model to read.

### Why convert HTML to Markdown for AI?

An AI model reads a page inside a limited context window. Markdown keeps the headings, lists, tables and links and drops the markup, so the same content takes fewer tokens. The size numbers above show the difference for your page. Read more in do AI crawlers render JavaScript (https://encited.com/blog/do-ai-crawlers-render-javascript).

### Is the HTML to Markdown converter free?

Yes. It's free and you don't need an account.

## More free SEO tools

- SEO Audit 30 checks for crawlability, SEO, and AI readiness: https://encited.com/free-tools/seo-audit
- Crawler Simulator See what 100+ search and AI bots get from your page: https://encited.com/free-tools/crawler-simulator
- Googlebot Simulator Fetch your page as Googlebot Smartphone or Desktop: https://encited.com/free-tools/crawler-simulator/googlebot-simulator
- Verify Googlebot Check if a crawler IP really belongs to Google: https://encited.com/free-tools/verify-googlebot
- Redirect Checker Trace redirect chains and the status code of each hop: https://encited.com/free-tools/redirect-checker
- Robots.txt Checker Check which crawlers are allowed or blocked: https://encited.com/free-tools/robots-txt-analyzer
- OG Image Checker Check OG images and preview social link cards: https://encited.com/free-tools/og-image-previewer
- Meta Tag Audit Audit meta tags and generate a fix prompt: https://encited.com/free-tools/meta-tag-audit
- AI Readiness Checker Check if ChatGPT, Claude and Perplexity can read your site: https://encited.com/free-tools/ai-crawl-checker
- llms.txt Generator Generate and validate an llms.txt file: https://encited.com/free-tools/llms-txt-generator
- Hreflang Checker Validate hreflang codes and return links: https://encited.com/free-tools/hreflang-checker
- Canonical URL Checker Check canonical tags and their targets: https://encited.com/free-tools/canonical-checker

## Related guides

- Do AI Crawlers Render JavaScript? What GPTBot, ClaudeBot and PerplexityBot See: https://encited.com/blog/do-ai-crawlers-render-javascript
- SEO for ChatGPT: 12 Steps to Get Indexed and Cited: https://encited.com/blog/how-to-get-pages-indexed-by-openai-chatgpt
- SPA SEO: Get a Single-Page App Indexed and Cited: https://encited.com/blog/spa-seo
- What Is Pre-rendering for SPAs?: https://encited.com/docs/pre-rendering/what-pre-rendering-gets-you

> “Encited has become my go-to for all Lovable projects. I saw an uptick in crawls almost immediately after switching. Honestly one of the best dev/SEO tools I’ve used. Aki was also amazing on support. Love it!”

Image: Kyle Davidson (https://encited.com/users/kyledavidson.webp)

Kyle Davidson

Co-founder at Shoutout.io

Trusted by over 5,000 brands and agencies

Image: Shoutout.io (https://encited.com/clients/client-shoutout-io.png)

Image: Optimum Service Marketing (https://encited.com/clients/client-optimumservicemarketing.webp)

Image: Brilus (https://encited.com/clients/client-brilus.svg)

Image: Local Marketing Vault (https://encited.com/clients/client-local-marketing-vault.png)

Image: API Worx (https://encited.com/clients/client-api-worx.webp)

Image: Main Street Marketer (https://encited.com/clients/client-mainstreet-marketer.png)

AI-native markdown

## Serve your pages in AI-optimized markdown

An agent reads your page inside a context window it shares with the question and every competitor page it pulls in. Each snapshot is post-processed into lean HTML for search engines and Markdown for AI agents, so your specs, prices and reviews make it into the answer.

- Specs, prices and reviews stay intact for AI answers
- Same URL for every agent, no separate feed to maintain
- Lean HTML for search engines from the same snapshot

Book a demo: https://encited.com/book-a-demo

Tokens per format

/products/alpine-trek-gtx

- Rendered page What a headless browser sees 21,400
- Lean HTML
  Image: Google (https://encited.com/crawler-logos/google-search.svg)
  Image: Bing (https://encited.com/crawler-logos/bing.svg) Served to search engines 7,900
- Markdown
  Image: ChatGPT (https://encited.com/logos/chatgpt.svg)
  Image: Claude (https://encited.com/crawler-logos/claude.svg)
  Image: Perplexity (https://encited.com/crawler-logos/perplexity.svg) Served to AI agents 2,650

GET /products/alpine-trek-gtx

Accept: text/markdown

200 text/markdown · 18ms from the edge

Image: Avatar (https://replymaven.com/api/uploads/Su6Q0nK63iZW0ZFJBRNWpmRuppVDLuab/98df5262-f992-45fa-a750-00a6c919baf9.png)

How can we help?

Get instant answers to your questions or leave a message for an engineer will reach out

Ask AI about Encited

See our docs (https://lovablehtml.com/docs)

Contact support

Leave a message

We'll get back to you soon

Ask AI about Encited

Product questions, troubleshooting and

Thinking

Image: Preview

Drop an image to attach

Powered by ReplyMaven (https://replymaven.com/)