Kharabeesh
On-device ع

HTML to Markdown (and Back)

Turn HTML code, or rich text copied from a page or document, into clean Markdown: headings, nested lists, links, images, tables and code. Also works in reverse, Markdown to HTML.

Free, no sign-up Your data stays on your device Works offline after first open

The tool

Loading the tool…

How to use

  1. Choose the direction: HTML to Markdown or the reverse.
  2. Paste the code, or copy part of a web page or document and paste it (formatting is picked up automatically), or open a file.
  3. The result appears immediately. Adjust the options to drop links or images.
  4. Copy the result or download it as .md or .html.

Privacy & how it works

Processes your data in the browser and stores nothing.

  • Engine: marked + dompurify (open-source libraries bundled with the site).
  • Works offline after you open it once.

Frequently asked questions

What gets converted?

Headings, paragraphs, bold, italic and strikethrough, links, images, ordered, bulleted, nested and task lists, blockquotes, inline code and code blocks, tables (GFM), horizontal rules and line breaks.

What is dropped?

Scripts, styles, forms, frames and comments. Colours, fonts and alignment have no Markdown equivalent, so they are lost. Complex tables (vertically merged cells, or no header row) are converted in the simplest possible form and need checking.

Does the code I paste run inside the page?

No. The HTML is parsed as an isolated document and its elements are walked without being displayed or executed, and no image or file is loaded from it. In the reverse direction, the HTML output is cleaned of any script before it is shown to you as text.

Why are embedded images missing?

Images stored inside the code itself (data:) are extremely long and would wreck a Markdown file, so they are skipped and counted for you. Images with a normal link convert as usual.

Related tools