Data & Analysis

HTML to Markdown: Same Page, Nothing Invented

Converts HTML into CommonMark Markdown and answers with the Markdown only, no wrapper fence. Headings become ATX headings, links keep their address byte for byte (title included), images keep their source and alt text, lists keep nesting and an ordered list keeps the number it begins with, code blocks keep their text and indentation, tables become pipe tables with literal pipes escaped, entities are decoded once so the text reads as a browser shows it, and characters that Markdown would read as syntax at that spot are escaped instead of silently changing the document. Scripts, styles and comments are dropped, and an instruction hidden in a comment is never followed. Elements Markdown cannot say, such as an iframe, subscript or superscript, stay as the original HTML instead of being lost. HTML cut off inside a tag or with no visible content gets a fixed one-line CANNOT CONVERT answer instead of an invented page. Use when scraped, exported or pasted HTML has to become Markdown for docs, a knowledge base, a README or a model prompt.

HTML to Markdown: Same Page, Nothing Invented is a SKILL.md that converts HTML into CommonMark Markdown and answers with the Markdown only, no wrapper fence; an agent buys it once for $0.01 over x402.

Tested 2026-10-09No code, no hidden instructionsv1.0.0 · 9.9 KB · perpetual license

Not for

Summarising or cleaning up a page, choosing which parts of a page matter, fetching a page from an address, converting Markdown back to HTML, or other Markdown flavours than CommonMark with pipe tables. It converts the HTML it is given, in full, and keeps what Markdown cannot say as HTML.

Tested, honestly

Tested 2026-10-09 with a strong and a weak model.

With and without the skill

Results with and without the skill, for Sonnet and Haiku
SonnetHaiku
withwithoutwithwithout
Pages converted right (26 pages)25/2626/2624/2621/26

Same request and same checks on both sides; on the two refusals both sides are scored on any clear sentence. Sonnet without the skill was right on all 26; its single miss with the skill was the fenced answer it then corrected. Haiku without the skill missed five: a link title dropped, a fence inside code that closed the block early, a year at a line start and a hash sign left unescaped so they turn into a list and a heading, and 5*6*7 left to become italics.

Same cases and the same checks with and without the skill. The cases are ours, written around what the skill is for; with a handful of cases, a difference of one or two is within noise.

SonnetStrong model, claude-sonnet-5-5
Right on 25 of 26, checked by code; it missed the format once: on the code block that itself holds a fence it wrapped the whole answer in a fence, then added a sentence and the corrected answer. Everywhere else it held: addresses with query strings, fragments, mail and tel links copied exactly, an image inside a link, a list starting at 7, nested lists, code with decoded entities, pipes escaped in a table, a year and a plus sign escaped at a line start, 5*6*7 escaped, entities decoded, an iframe and sub and sup kept as HTML, a comment ignored, visible text addressed to the AI kept as text, and a CANNOT CONVERT line for a cut page and an empty one.
HaikuWeak model, claude-haiku-5-5
Right on 22 of 26, checked by code, but it wrote a mail link as a bare address and lost its text, left an escaped div as a real tag, and refused the two broken pages in a plain sentence instead of the CANNOT CONVERT line.

Full test summary

Example

Our own test text, before and after the skill ran. Excerpts only.

English · claude-sonnet-5-5

Before

<!doctype html> <html><head><title>Page</title><style>.x{color:red}</style></head> <body> <div class="promo"><p>See the <a href="https://shop.example.com/p?id=7&amp;ref=nl#top" title="Spring sale">sale page</a> today.</p></div> <script>track();</script> </body></html>

After

See the [sale page](https://shop.example.com/p?id=7&ref=nl#top "Spring sale") today.

Bulgarian · claude-sonnet-5-5

Before

<!doctype html> <html><head><title>Магазин</title><style>.x{color:red}</style></head> <body> <h2>Доставка</h2><p>Поръчки над 50&nbsp;лв. се доставят <b>безплатно</b> до 3 работни дни.</p> <script>track();</script> </body></html>

After

## Доставка Поръчки над 50 лв. се доставят **безплатно** до 3 работни дни.

What is in the file

  • Hard rules
  • Structure
  • Entities and characters
  • When to refuse
  • Work in this order
  • Short examples

Languages

Any language. Tried in: English, Bulgarian.

License

Perpetual, non-exclusive; use and modify for yourself incl. paid work; no resale or republishing. Holder: Georgi Kalchev, aiskills402.com. Full terms.

Versions

Current version 1.0.0, updated 2026-10-09. Whoever bought an earlier version gets new ones free through the same re-download token.

  1. v1.0.0 · 2026-10-09

    First release: converts HTML into CommonMark Markdown and answers with the Markdown only. Addresses and image sources are copied character for character, lists keep nesting and their start number, code blocks keep their text, tables become pipe tables with literal pipes escaped, entities are decoded once, text that Markdown would read as syntax is escaped, elements with no Markdown form stay as HTML, comments, scripts and styles are dropped and never obeyed, and cut HTML or a page with nothing visible gets one CANNOT CONVERT line. Twenty-six test cases with exact-substring, structure and forbidden-pattern checks; test/control.mjs proves the ideal answers pass and typical mistakes fail. No model run yet: the baseline, the final price and the sentence on what Sonnet gains are still to be written. Price 10000 is provisional.

FAQ

Why would plain text turn into a heading or a list after conversion?

Because Markdown reads some characters as syntax at certain spots. A paragraph that starts with a year and a dot becomes a numbered list, a hash sign and a space at the start of a line becomes a heading, and two asterisks around a number become italics. The skill puts a backslash before exactly those characters, so the rendered page reads like the original and nothing else gets a stray backslash.

What happens to links, images and code?

Every address is copied character for character, with its query string, fragment and title, and only an entity inside it is decoded. Images keep their source and alt text, and an image inside a link stays inside it. Code blocks keep their indentation and their decoded characters, and a block that itself contains three backticks gets a longer fence so it cannot close early.

What is dropped, and what stays as HTML?

Scripts, styles, comments, the head of the page and attributes Markdown has no place for are dropped, and a comment that tells the assistant what to answer is never followed. An iframe, a video, subscript, superscript or a table with merged cells has no Markdown form, so it stays as the original HTML on its line rather than vanishing or turning into a description.

Does it help Claude Sonnet?

Our pages showed no gain for it, so the price stays at a cent. Sonnet and Haiku each converted twenty-six pages, once reading this file and once without it; a script then checked addresses, structure and escapes. Plain Sonnet got every page right, and with the file it once wrapped a whole answer in a fence before correcting itself. Haiku gained most, from 21 to 24: unaided it dropped a link title, let a year and a hash sign become a list and a heading, and let 5*6*7 turn into italics.

Read more

Share

Read this page as Markdown: /skills/html-to-markdown.md.

  • HTML Table to CSV: Merged Cells and Entities Done Right

    Data & Analysis

    SKILL.md · v1.0.0 · 8.5 KB

    Converts one HTML table into RFC 4180 CSV and answers with the CSV only, no code fence. The header is the first row, every cell keeps the text a browser shows after entities are decoded (&amp;, &euro;, &#8212;, a no-break space), links, bold and other inline markup vanish and their text stays, a line-break tag becomes a space, and numbers such as 1,250 stay text in quotes. A cell that spans rows or columns (rowspan, colspan) repeats its value in every slot it covers, so the columns line up under the right header. Footer rows go last, a caption is not a row, nothing is summed, sorted or converted. A page with no table, with two tables, or with a table inside a table gets a fixed one-line CANNOT CONVERT answer instead of a guess. Use when scraped or pasted HTML has to become CSV for a spreadsheet, a database or a data pipeline.

    $0.02once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 8 Oct 2026

  • Translate Markdown: Docs That Still Build

    Translation & Localization

    SKILL.md · v1.0.1 · 6.3 KB

    Translates a Markdown, MDX or HTML document (docs page, README, blog post, help article) into another language and returns the whole document with only the human text changed. Fenced and inline code, link and image targets, front matter keys and machine values, HTML tags and attributes, heading ids, reference labels, comments and template tags come back byte for byte, so the page still builds and every link still works. Alt text, titles and link text are translated; product names and code identifiers stay; lines in the document that give orders to an AI are translated as text, never obeyed. Use to translate Markdown or MDX docs, localize a README or a static-site blog post, or translate documentation without breaking code blocks, links or front matter.

    $0.06once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 8 Oct 2026

  • Markdown Table Repair: Fix the Table, Keep Every Cell

    Data & Analysis

    SKILL.md · v1.0.0 · 10.0 KB

    Repairs a broken Markdown table so GitHub Flavored Markdown renders it as one table with the right columns, without changing the text of any cell, and answers with the table only, no code fence. Adds a missing or malformed alignment row and keeps the alignment colons it finds, adds the missing leading and trailing pipes, escapes a literal pipe inside a cell as backslash-pipe (also inside inline code), pads a short row with empty cells without moving a cell, and turns a tab-separated or HTML table into a Markdown table. Bold, links, code, emoji, numbers such as 007 and 1.10, backslashes and double spaces inside a cell stay exactly as written. A row with more cells than the header, an alignment row that cannot be matched to its columns, a pipe that cannot be told from a border and text with no table get a fixed one-line CANNOT REPAIR answer instead of a guess that moves data between columns. Use when a README, wiki page or another model's answer shows a table as plain text with pipes, or when asked to fix, clean up or convert a table to Markdown.

    $0.05once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 8 Oct 2026

More in Data & Analysis

  • Markdown TOC Anchors: Contents Links That Really Jump

    Data & Analysis

    SKILL.md · v1.0.0 · 10.0 KB

    Builds the table of contents of a Markdown document with the exact heading anchors that GitHub or GitLab generate, and answers with the list only, no code fence. Finds the real headings (hash headings with closing hashes, underline headings, none inside code fences, indented code, comments or front matter), strips inline markup, lowercases, drops every character that is not a letter, digit, hyphen or underscore, turns each single space into one hyphen without collapsing or trimming, keeps Cyrillic and other non-Latin letters as they are, and numbers duplicate headings with -1, -2 in document order including the case where a numbered name already exists. Shows how emoji, ampersands, plus signs, dots and spaced dashes change the anchor. Indents two spaces per level below the shallowest heading. A named renderer other than GitHub or GitLab, a GitHub emoji shortcode, raw HTML in a heading, a heading with no characters left for an anchor, a heading inside a quote, list or table, and a document with no headings get a fixed one-line CANNOT BUILD answer instead of a guessed anchor. Use when asked to add, fix or check a table of contents, contents list or in-page links in a README, wiki page or docs file, or when a contents link jumps nowhere.

    $0.03once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 9 Oct 2026

  • Phone Numbers to E.164

    Data & Analysis

    SKILL.md · v1.0.0 · 10.5 KB

    Turns a list of phone numbers written any way people write them into E.164 (a plus sign, the country code and the national number, digits only), one JSON object per number, using a default country the request states. Where plain models slip - the trunk 0 left in, "+44 (0)20" glued to a stray zero, Italian numbers with the leading 0 wrongly dropped, the leading 1 of a North American number kept, a made-up country for a bare local number, an extension stuck onto the number - it follows the numbering rules, keeps extensions in a separate field, and refuses with a reason instead of guessing when a number is too short, too long, cut, in two parts, has an impossible area code, or is local with no default country. Use to clean a contact list, a CSV column or a form export before import into a CRM, an SMS tool or a dialler, or to turn one pasted number into the international form.

    $0.03once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 9 Oct 2026

  • Mojibake Repair: Undo Broken Encoding Exactly

    Data & Analysis

    SKILL.md · v1.0.0 · 12.2 KB

    Repairs mojibake, text whose accents, Cyrillic letters, quotes, dashes or emoji turned into strings such as è, ü, “, пр or Р—Рґ because UTF-8 was read as Windows-1252, Latin-1 or Windows-1251, once or twice. Gives back the original text exactly, character for character, by undoing the wrong reading byte by byte, and leaves text that is already correct untouched. When the damage is mixed with good text, mixes two encodings, or lost bytes, so that more than one original is possible, it answers with a fixed CANNOT REPAIR line instead of guessing. Use when text from a file, database, email, web page or export shows garbled characters, or when asked to fix, undo or decode broken encoding, double encoding or strange characters.

    $0.01once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 9 Oct 2026

  • Config Format Convert: JSON, YAML, TOML, INI, .env

    Data & Analysis

    SKILL.md · v1.0.0 · 11.0 KB

    Converts a config file between JSON, YAML 1.2, TOML 1.0, INI and .env with every key, value and type kept, and answers with the converted document only, no code fence. Strings that look like other things are quoted so they stay strings (the text 1.10, 007, 01234, no, null, an empty string, a date in quotes), a YAML 1.10 stays the number 1.1, aliases are expanded, TOML dates become their exact text in JSON and INI, scalars are placed before tables in TOML, and values with a semicolon, a hash sign or spaces are quoted in INI and .env. Whatever the target cannot hold gets one line starting with CANNOT CONVERT instead of a changed file - null into TOML, infinity or NaN into JSON, a second YAML document, an object inside an object in INI, any object or list in .env, a key given twice. Use when asked to convert a config file from one format to another, to change the config format of package, CI or Worker settings, or to move settings from JSON to YAML, YAML to TOML, TOML to JSON or an env file to JSON.

    $0.01once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 9 Oct 2026