OnlineNotes Logo

    HTML to Markdown

    Convert pasted HTML into markdown for migration projects, static docs handoff, and long-form archive cleanup.

    Input

    Output

    When to use this tool

    Use this page when you move HTML into markdown docs or static site content.

    You can sanitize input, convert it, and check the rendered result in one pass.

    Frequently asked questions

    When should I convert HTML to markdown?

    Use this when moving CMS content to markdown repositories or static documentation pipelines.

    Will every HTML pattern map to markdown?

    No. The converter prioritizes readable markdown where one-to-one mapping is not possible.

    Why keep a round-trip preview?

    Round-trip preview shows how generated markdown renders, so structure issues are easier to catch.

    Related tools

    HTML to markdown converter for docs migration and archive cleanup

    This HTML to markdown converter turns old knowledge-base articles and CMS exports into markdown you can keep in a Git repository.

    The Preview view renders the markdown it just produced, so you can compare headings, lists, and code blocks with the source before you copy the result.

    How it works

    1. Paste HTML into the editor. The tool sanitizes it first at the level you choose (Balanced or Strict), and only then converts it to markdown.
    2. The converter uses ATX headings (##), a hyphen for bullets, underscores for emphasis, double asterisks for bold, fenced code blocks, and ~~ for deleted text.
    3. Use the Markdown view for the result, the Preview view to see that markdown rendered, and the Sanitized HTML view to see what reached the converter.
    4. Press Copy markdown to take the result.

    Worked example

    Input

    <h2>Release notes</h2>
    <p>Fixed <em>login</em> and <strong>export</strong>. See <a href="https://example.com/docs">docs</a>.</p>
    <ul><li>One</li><li>Two</li></ul>
    <pre><code class="language-js">let a = 1;</code></pre>

    Output

    ## Release notes
    
    Fixed _login_ and **export**. See [docs](https://example.com/docs).
    
    -   One
    -   Two
    
    ```js
    let a = 1;
    ```

    Output at the Balanced level. List items get three spaces after the hyphen, which is the converter's default and still valid markdown. The language-js class on the code element becomes the language name on the code fence.

    Edge cases and limits

    • At Balanced, tables become markdown pipe tables, using the first row as the header. Merged cells (colspan and rowspan) are not rebuilt, so check those by hand.
    • Strict is harsher on tables and images. It removes images, drops the header row text, and joins the remaining cells into loose text ("12" for cells 1 and 2).
    • Anything the sanitizer removes never reaches the converter. Classes, ids, inline styles, and tags such as u are lost, though their text stays. Only del and s produce ~~ strikethrough, and only at Balanced.
    • Nested lists are kept and line breaks become two trailing spaces, but the tool does not fix the source text, change heading levels, or follow links and images.

    When to use it

    • Convert old support articles into markdown for Git-based documentation.
    • Tidy exported CMS content before opening a pull request.
    • Turn an HTML release announcement into a markdown draft.
    • Read the sanitized HTML first when you do not trust where the content came from.