Turning Noisy Web Markup and DOM Trees into Clean Markdown
Web pages and copied rich-text selections carry heavy scaffolding: inline style attributes, tracking scripts, analytics pixels, nested layout divs, and repeated navigation links. Feeding raw HTML into a language model wastes tokens and confuses vector embeddings. ConvertToMD parses the HTML structure locally, strips executable tags and styling boilerplate, and maps semantic landmarks directly to ATX headings, fenced code blocks, ordered lists, blockquotes, and GFM tables.
Beyond full .html files, you can paste copied sections from documentation portals, CMS drafts, or browser reader views directly into the input box. Semantic <code>, <pre>, <a>, and <table> nodes retain their links and structure cleanly while empty wrapper elements vanish automatically.
HTML Element Mapping Reference
| HTML Tag / Pattern | Markdown Output | Edge-Case Handling |
|---|---|---|
<h1> through <h6> | # through ###### ATX headings | Nested spans unwrapped cleanly |
<pre><code class="language-ts"> | Triple-backtick fenced block with lang | Preserves indentation & special chars |
<table>, <thead>, <tr>, <td> | GFM pipe table with header separator | Escapes internal | characters |
<script>, <style>, <noscript> | Completely stripped from output | Prevents XSS noise & token waste |
Online DOM Cleanup vs. Pandoc / Turndown Scripts
Libraries like Turndown or Pandoc require a Node.js or terminal setup. ConvertToMD delivers instant visual feedback in the browser—making it faster when auditing single articles, email templates, or CMS migrations before committing Markdown to Astro, Next.js, or Hugo.