Skip to content
YAS.SH
Developer🌐 YAS server-sideAPI availableintermediate

HTML → Markdown

Converts simple HTML into clean Markdown.

Processed by YAS · not stored
Ready to runInstant execution
All tools →
Loading tool…

What does this tool do?

Converts simple HTML into clean Markdown.

Why would I use it?

  • You are migrating a webpage's content into a Markdown document.
  • You want readable plain text from a rendered page.
  • You are preparing documentation from existing HTML.

Real-life example

Input
<h1>Title</h1><p>Hello <strong>world</strong></p>
Output
# Title

Hello **world**

Headings, bold, links and lists map to Markdown syntax.

Input → Process → Output → Next

Input
Paste HTML.
Process
YAS parses the HTML and emits Markdown equivalents.
Output
Markdown text.
Next action
Review complex tables/divs — they may not convert perfectly.

Common mistakes

  • Expecting complex layouts (divs, tables) to convert cleanly.
  • Losing inline styles and classes — Markdown has no styles.
  • Pasting an entire page including scripts/nav.

What the result means

The output is a best-effort Markdown representation of the semantic content.

Privacy & security

Your input is sent to YAS infrastructure because the tool requires server-side processing or public network queries. Input is not stored.

API

Endpoint
POST https://yas.sh/api/v1/tools/html-to-markdown
Request Header
Content-Type: application/json
cURL
curl -X POST "https://yas.sh/api/v1/tools/html-to-markdown" \
  -H "Content-Type: application/json" \
  -d '{"input":"<h1>Title</h1><p>Hello</p>"}'
JavaScript
const res = await fetch("https://yas.sh/api/v1/tools/html-to-markdown", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
  "input": "<h1>Title</h1><p>Hello</p>"
}),
});
const data = await res.json();
Python
import requests

r = requests.post("https://yas.sh/api/v1/tools/html-to-markdown", json={"input":"<h1>Title</h1><p>Hello</p>"})
data = r.json()
FieldTypeRequiredDescription
inputstringYesHTML text
Success response
{ "result": "# Title\n\nHello\n\n" }

Convert simple HTML into Markdown.

Error responses
  • 400 VALIDATION_ERROR — invalid input or unsupported option.
  • 413 PAYLOAD_TOO_LARGE — input exceeds the 64 KB limit.
  • 429 RATE_LIMIT_EXCEEDED — rate limit exceeded (60 req/min).
Limits
  • Maximum input: 64 KB per request.
  • Rate limit: 60 requests/min per IP address.
  • Authenticated accounts benefit from higher tier quotas.

HTML → Markdown: technical reference, use cases and FAQ

How HTML → Markdown works

The HTML is parsed into a DOM and walked depth-first, mapping each element to its Markdown equivalent: h1–h6 to ATX headings, strong/b to double asterisks, ul/ol to list markers, pre/code to fenced blocks, a to inline links. Elements with no Markdown equivalent are either unwrapped (their children are kept) or dropped, depending on whether they carry content or only presentation.

The lossy direction is deliberate. HTML expresses arbitrary structure and styling; Markdown expresses a small fixed vocabulary. A div with a class, a span with a colour, a table with merged cells and a figure with a caption have no Markdown representation, so the converter preserves the text and discards the presentation rather than emitting raw HTML that would defeat the purpose of converting.

When to use it: real-world scenarios

Migrating a CMS export into a static site

WordPress and Contentful export HTML; Astro, Hugo and Next.js content pipelines want Markdown. Converting in bulk gets you 90% there, with tables and embeds needing manual review.

Turning a documentation page into an issue or PR description

Copying rendered HTML into a Markdown field produces escaped tag soup. Converting first yields clean, editable source.

Extracting readable text from a scraped page

Markdown keeps the heading hierarchy and link targets that plain-text extraction throws away, which matters when the structure is the information.

Normalising rich-text editor output for storage

Storing Markdown instead of editor-specific HTML makes content portable when you replace the editor — and you will replace the editor.

Pro tips

  • Strip navigation, headers and footers before converting a full page, or the Markdown will be mostly chrome.
  • Check tables first. Colspan and rowspan cannot be represented in Markdown tables and will need manual restructuring.
  • Convert relative URLs to absolute before conversion, or every link will break once the Markdown lives at a different path.
  • Round-tripping HTML → Markdown → HTML will not reproduce the original markup. Treat the Markdown as the new source of truth, not as a reversible encoding.

Limitations and edge cases

What this tool deliberately does not do, and where it will disagree with other implementations.

  • Presentation is discarded: classes, inline styles, data attributes and custom elements do not survive.
  • Merged table cells, nested tables and definition lists have no Markdown form.
  • Embedded media (iframe, video, object) is dropped rather than converted to a link.
  • Malformed HTML is parsed leniently, following the same error-recovery rules a browser uses, so the result may differ from what the author intended.

Frequently asked questions

Why did my styling disappear?
Markdown has no styling vocabulary — no colours, fonts or classes. Only structure and emphasis survive, which is the point of converting to a portable format.
Are tables converted?
Simple rectangular tables convert to GFM pipe tables. Anything using colspan, rowspan or nested tables cannot be represented and needs manual work.
Can I convert a whole page by URL?
Not here — this tool takes HTML you paste, which keeps it browser-local. Fetch the page yourself and paste the body, or use the HTTP Header Viewer to inspect what a URL returns.
Is the conversion reversible?
No. It is deliberately lossy: HTML is a superset of what Markdown can express, so information without a Markdown equivalent is discarded.
Ask YAS AI
🍪 Cookies & privacy. Essential cookies keep you signed in and remember language and theme. Google AdSense and reCAPTCHA are Google technologies: AdSense runs only after Accept All; reCAPTCHA loads on sign-in and contact forms. See how Google uses data: https://policies.google.com/technologies/partner-sites cookie policy · privacy policy.
Settings