Skip to content
OddsockLocal
Local
Source text

Notes

  • Red sock
  • Blue sock
  • 8 wordsRuns in this browser. Nothing is uploaded.

    How to use

    1. Paste the HTML fragment.
    2. Read the Markdown. Hashes, asterisks, and fences replace the tags.
    3. Check that javascript: links became bare labels.
    4. Copy the Markdown into the file. This page does not save it for you.

    What is HTML to Markdown?

    HTML from a CMS is a tree. Markdown is a text convention. This page parses the fragment, removes script, style, template, object, embed, iframe, svg, math, noscript, textarea, form, base, link, and meta, then converts what remains. Headings are ATX hashes. Bold is **. Code blocks are fenced. Lists use a hyphen. “<h1>Odd socks</h1><p>In the <strong>dryer</strong>.</p>” becomes a hash line “Odd socks”, a blank line, then “In the **dryer**.”

    Read more

    Links are kept when the address is http, https, mailto, or tel, or a relative path such as /there. A javascript: address is stripped, and the label remains as plain text, so a “bad” link does not survive as a link. An ampersand entity is decoded: “Tea &amp; cake” becomes “Tea & cake” in the heading. Angle brackets in the text are escaped so the Markdown does not turn back into HTML by accident.

    “Odd socks in the dryer.” with no tags comes back as that sentence. There is nothing to convert. You do not get a table of contents, and you do not get a live preview. Those are other pages. The conversion is a string you can paste into a Markdown file.

    Use cases

    • An editor moving a CMS article into a Markdown repo.
    • A developer stripping a script tag out of an HTML email before quoting it.
    • A writer keeping a real https link and losing a javascript: link.
    • A student turning a simple heading and paragraph into hashes and blank lines.
    • A security review confirming that a script body did not appear in the Markdown.

    A heading, a bold word, a script

    <h1>Odd socks</h1><p>In the <strong>dryer</strong>.</p><script>leak()</script>

    # Odd socks In the **dryer**. The script element is gone, including leak(). The bold word is Markdown, not a <strong> tag.

    Why use Oddsock

    Oddsock runs this in your browser. It is free, it does not upload the work, and it does not ask for an account.

    Related tools

    Using this tool

    The element is removed before conversion, contents included. leak() does not appear in the Markdown.