HTML to Markdown Converter
Paste HTML, or copy part of any web page and paste it here, and get clean Markdown for ChatGPT, Claude, GitHub or your notes. It runs in your browser.
HTML
0 charactersFormatted content copied from a page is pasted as its HTML. Nothing is uploaded or run.
Options
Markdown
- ChatGPT tokens
- ≈ 0
- Claude tokens
- ≈ 0
- Gemini tokens
- ≈ 0
Token counts are estimates, not exact. How they're estimated
Split into parts for a chat
For long documents: each part fits one message and keeps headings, tables and code blocks whole. A table that has to be split repeats its header row in every part.
Why convert HTML to Markdown?
Raw HTML is mostly scaffolding: tags, classes, inline styles, scripts and tracking code that carry no meaning once you only want the words. Markdown keeps the structure (headings, lists, links, tables, code) in a fraction of the characters and tokens, which matters when you paste a page into ChatGPT, Claude or Gemini, and it's the native format of READMEs, wikis, static sites and note apps.
How to convert HTML to Markdown
- Paste HTML source, open an .html file, or copy part of a web page and paste it.
- For a whole page, tick Main content only to drop menus, footers and banners.
- Choose how to handle links and images, and add a base URL if relative links should become absolute.
- Copy the Markdown or download it as a .md file; check tables in Preview.
Three ways to get a page's HTML
- Copy and paste the page itself. Select the article or section in your browser, copy, and paste here. The clipboard holds the formatted HTML as well as plain text, and the converter uses the HTML, so links, lists and tables survive. This is the quickest way, and works on phones too.
- View the source. Press Ctrl+U (⌥⌘U on a Mac) to see the page's HTML, select all, copy and paste. Then tick Main content only to leave out the site's navigation and footer.
- Save the page. Use your browser's Save Page As (HTML only) and open the file here with Open .html, or drop it on the box.
This page can't fetch a URL for you: browsers block one site from downloading another's pages, and routing them through a server would send your pages to someone else. Everything here runs on your device.
What each HTML element becomes
| HTML | Markdown |
|---|---|
| <h1> … <h6> | # … ###### |
| <strong>, <b> / <em>, <i> | **bold** / *italic* |
| <a href> | [text](url), or <url> when the text is the URL |
| <img> | , [Image: alt], or nothing |
| <ul>, <ol>, nested lists | - and 1. lists, indented per level |
| <table> with colspan/rowspan | Pipe table on a full grid; <caption> in bold above |
| <pre><code class="language-js"> | ```js fenced block |
| <blockquote> | > quote |
| <dl><dt><dd> | **Term** then : definition |
| <input type=checkbox> in a list | - [x] task list item |
| <script>, <style>, forms, <svg> | Removed, text and all |
Classes, inline styles, <span> and <div> wrappers, comments and empty elements leave no trace. Characters that would accidentally become Markdown formatting are escaped, but only where needed: snake_case stays as it is.
Example
With the base URL set to https://example.com/, this snippet:
<article>
<h2>Release notes</h2>
<p>Version <strong>2.4</strong> adds <a href="/docs/export">CSV export</a>.</p>
<ul><li>Faster sync</li><li>Dark mode</li></ul>
<img src="data:image/png;base64,iVBORw0KGgo…" alt="Export dialog">
</article>becomes:
## Release notes
Version **2.4** adds [CSV export](https://example.com/docs/export).
- Faster sync
- Dark mode
The relative link is made absolute, and the base64 image (often tens of thousands of characters) is replaced with a short placeholder that keeps its alt text.
Cleaner input for AI prompts
- See the saving. Under the result, the input and output token estimates show how much smaller the Markdown is than the HTML you pasted. In our tests on full page sources the Markdown used 80–95% fewer tokens.
- Cut what the model doesn't need. Links: Text only drops URLs, which are long and rarely useful to a model; Images: Remove drops pictures entirely.
- Split long pages. Split into parts divides a long article at headings and paragraphs, each part sized for one chat message.
- Other formats. Use DOCX to Markdown for Word files, PPTX to Markdown for slides and JSON/XML to Readable Text for API responses and feeds. To polish the result, try the Markdown Cleaner or the Markdown Editor; to shrink HTML instead of converting it, the Code Minifier.
How the token estimates work
The input figure counts the HTML exactly as pasted, tags and all, so you can compare it with the Markdown.Chat models read text as tokens: whole words, pieces of longer words, numbers and punctuation. Each model family splits text its own way, so one document has a different count in ChatGPT, Claude and Gemini. The counts here are worked out in your browser, without sending the text anywhere:
- ChatGPT: the text is cut up with the same splitting rules as OpenAI's o200k tokenizer (used by GPT-4o and later models), and each piece is costed from statistics measured on that tokenizer. In our tests it came within about 5% of the real count for English prose, Markdown and code; for JSON, HTML and some languages it can be 10–30% off.
- Gemini: calibrated the same way against the tokenizer Google released with its open Gemma 3 models, which Google's Gemma 3 report describes as the one Gemini 2.0 uses. It splits every digit into its own token, so tables and numbers cost noticeably more than the usual "about 4 characters per token" rule of thumb suggests. In our tests it was within about 10% for English text, code and data.
- Claude: Anthropic doesn't publish its tokenizer, so this is the roughest of the three. Claude typically counts 15–20% more tokens than OpenAI's tokenizer for English and more for code, numbers and non-Latin scripts; the estimate applies those ratios to the ChatGPT figure. The newest Claude models can count somewhat more again.
Treat them as planning numbers: good for "will this fit?" and for splitting, not for billing. When you split a document into parts, choose a part size with some headroom below your model's limit, and remember that your own question and the AI's answer use tokens too.
Frequently Asked Questions
How do I convert HTML to Markdown?
Paste the HTML into the box, open an .html file, or drop one on the box. The Markdown appears as you type (press Convert for very large pastes). Copy it or download it as a .md file. Headings, lists, links, images, tables and code blocks are converted; scripts, styles and form controls are dropped.
Can I convert part of a web page by copying it?
Yes. Select the part of the page you want in your browser, copy it, and paste it into the box: the converter takes the formatted HTML from the clipboard rather than the plain text, so headings, links, lists and tables are kept. If you paste HTML source code instead, it's used as typed.
Can I convert a whole web page from its URL?
Not directly. Browsers don't let one site download another site's pages, and fetching them through a server would mean your pages pass through someone else's computer. Open the page, press Ctrl+U (or ⌥⌘U on a Mac) to view its source, copy it all and paste it here, or save the page as an .html file and open that.
How do I keep only the article and drop menus and footers?
Tick "Main content only". The converter keeps the page's main or article element when there is one, and removes navigation, site headers, footers, sidebars, cookie banners and share buttons. Untick it to convert everything that was pasted.
What happens to links and images?
Links become [text](url) and images  by default. Relative URLs like /docs/start are made absolute using the page's own <base> or canonical address, or a base URL you type. You can also keep only the link text, show images as their alt text, or leave images out, which saves tokens in an AI prompt. Embedded base64 images are replaced with a short placeholder.
Are HTML tables converted?
Yes, into GitHub-flavoured Markdown tables. Cells that span rows or columns are laid out on the full grid so every value stays in its column, a <caption> becomes a bold line above the table, and a table nested inside a cell is written as one line of text in that cell. One-column layout tables are unwrapped into paragraphs.
Will any scripts in my HTML run?
No. The HTML is parsed as inert data: scripts don't run, images and styles don't load, and nothing is rendered on this page. Script and style contents are removed so code never leaks into the Markdown.
Does it work with messy HTML from emails, Word or a CMS?
Generally yes. The browser's HTML parser repairs missing closing tags and other mistakes before conversion, and presentational markup (fonts, inline styles, classes, empty spans) is dropped. Very broken markup can still produce odd results, so check the Preview tab.
Why convert HTML to Markdown before giving it to ChatGPT or Claude?
Most of a web page's HTML is tags, attributes and scripts that carry no meaning for a model. Markdown keeps the structure in far fewer tokens; the result card shows the estimated tokens of your HTML and of the Markdown so you can see the saving. You can also check and trim the text before you send it.
Which Markdown flavour does it produce?
GitHub-flavoured Markdown: # headings, - lists, fenced ``` code blocks with the language kept when the HTML names it, pipe tables, ~strikethrough~ and [x] task lists. It's suitable for GitHub, GitLab, static site generators, Obsidian and AI chats.
Is my HTML uploaded anywhere?
No. Conversion runs in your browser tab and nothing is sent to a server. Your option choices are remembered in this browser; the HTML you paste is not stored.
Related tools
More free, private, browser-based utilities — no upload, no sign-up.