URL to Markdown

Paste a link and get the page back as Markdown: headings, paragraphs, lists, links, tables and code, without the site's menus and footer. Your AI assistant can read it, quote it or save it as a .md file, and your code can call the same tool.

  • Markdown + page title
  • Tested
  • REST API + MCP
  • Billed per run

1Your request

Use the AI/ML API MCP URL to Markdown tool. Convert the Python docs page for the json module to Markdown and keep the headings, links and code examples.

Site
docs.python.org
Page
json module reference
Selectors
None, whole page
Timeout
30 s, default

2Result668 lines of Markdown · 16 Nov 2026

Python docs, json module: lines 546 to 569 of 668

### Infinite and NaN Number Values[¶](#infinite-and-nan-number-values "Link to this heading")

The RFC does not permit the representation of infinite or NaN number values. Despite that, by default, this module accepts and outputs `Infinity`, `-Infinity`, and `NaN` as if they were valid JSON number literal values:

\>>> \# Neither of these calls raises an exception, but the results are not valid JSON

\>>> json.dumps(float('-inf'))

'-Infinity'

\>>> json.dumps(float('nan'))

'NaN'

\>>> \# Same when deserializing

\>>> json.loads('-Infinity')

\-inf

\>>> json.loads('NaN')

nan

In the serializer, the _allow\_nan_ parameter can be used to alter this behavior. In the deserializer, the _parse\_constant_ parameter can be used to alter this behavior.

### Repeated Names Within an Object[¶](#repeated-names-within-an-object "Link to this heading")

The RFC specifies that the names within a JSON object should be unique, but does not mandate how repeated names in JSON objects should be handled. By default, this module does not raise an exception; instead, it ignores all but the last name-value pair for a given name:

\>>> weird\_json \= '{"x": 1, "x": 2, "x": 3}'

\>>> json.loads(weird\_json)

{'x': 3}

Source: Real result from 16 Nov 2026, lines 546 to 569 of 668 shown exactly as returned, including the backslash escapes and the ¶ permalinks that the docs site puts after each heading.

What is URL to Markdown?

URL to Markdown fetches one public web page and returns its main content as Markdown, together with the page title and the final URL. You give it a link to a documentation page, a blog post, a changelog or a policy, and you get plain text that a language model, a notes app or a static site generator reads directly.

Markdown keeps the parts of a page that carry meaning: heading levels, lists, links, emphasis, inline code and tables. HTML tags, scripts and styles are gone, so a model spends its context on the words of the page and you can split the text at its headings.

You ask

Convert the Python docs page for the json module to Markdown and keep the headings, links and code examples.

It runs

URL to Markdown

From your AI assistant over MCP or from your code over REST

You get

  • Page
  • Structure
  • Links
  • Inline formatting
  • Tables and examples
  • Give a coding agent current docsHand Claude Code or Cursor the reference page for the library version you use before it writes code against it.
  • Build a retrieval corpusConvert the pages you trust, cut them at ## headings and index each chunk with its source URL.
  • Quote a source exactlyPull the paragraph behind a claim in your brief and keep the link next to it for the fact check.
  • Keep a dated text copySave a pricing page, terms page or changelog as Markdown today and compare it with next month's copy.
  • Read the article, not the chromeGet the body of the page without the navigation bar, sidebar and footer around it.

What a web page to Markdown conversion returns

Each run returns one page. The response has three parts: the final URL, the page title and the Markdown body as a single string. Inside that string, these are the elements our test conversion kept.

  • Page

    1. Final page URL
    2. Page title, in its own field
    3. Flag that says whether a cached copy was served
  • Structure

    1. Headings with their levels
    2. Paragraphs
    3. Bulleted lists
    4. Horizontal rules between sections
  • Links

    1. Link text with its target
    2. Link titles from the original page
    3. Relative paths and in-page anchors as the site wrote them
    4. Full URLs to other sites
  • Inline formatting

    1. Bold and italic text
    2. Inline code in backticks
    3. Characters escaped so the Markdown renders correctly
  • Tables and examples

    1. Tables as Markdown pipe tables
    2. Code examples as plain lines
    3. Note and warning labels as plain text

The body covers one URL. To collect many pages of a site, list them with Website Mapper or read them in one job with Website Crawler. When you need a few named values such as prices rather than the whole text, use Extract Data from Website Pages.

Sample output from a Python docs page

The excerpt at the top of this page comes from a real run on 16 November 2026: the Python standard library page for the json module, converted with default settings and no selectors. The tool returned 33,586 characters of Markdown in 668 lines, plus the page title and URL. The summary on the left was counted from that text.

One result in full

What the run returned

Page
docs.python.org/3/library/json.html
Page title
Returned in its own field, not in the body
Length
33,586 characters in 668 lines
Headings
5 second-level, 6 third-level
Links
155: 87 relative paths, 54 in-page anchors, 14 full URLs
Lists and tables
31 list items, 2 pipe tables
Code
44 interpreter prompt lines, no fenced blocks
Images
None on this page
Cache
Fresh fetch
Counted from the Markdown returned on 16 Nov 2026.

What we found in the Markdown

  • All 11 section headings came through with their levels, 5 at ## and 6 at ###, and none of the site's navigation, sidebar or footer text did. The page title sits in its own field, so add it as an H1 if your files need one.

  • 155 links kept their targets: 87 are relative paths such as ../glossary.html and 54 are anchors within the page. Resolve them against the page URL before you move the file somewhere else.

  • Code examples arrived as plain lines, 44 of them starting with an escaped >>> prompt, with no fenced code blocks. Indentation was lost in the pretty-printed JSON output and in the one example written without prompts. Wrap them in fences again if a model has to run them.

  • The docs site puts a ¶ permalink after every heading and definition, and all 35 of them stayed in the text. A single find-and-replace removes them before you index the file.

How to convert a URL to Markdown in your AI assistant

  1. Add AI/ML API to your client

    Click Try it now, choose Claude, ChatGPT, Cursor or another MCP client and add the server. You sign in with your AI/ML API account once.

  2. Paste the link

    Give the full URL and say what you want from the page: the whole text, one section or a quote.

  3. Read the Markdown

    Your assistant fetches the page and works from the converted text instead of guessing from its memory of the site.

  4. Use it in the same chat

    Ask for a summary of one section, a table rebuilt from the page, or a .md file named after the page title.

Prompts to start with

  • Use the AI/ML API MCP URL to Markdown tool. Convert https://docs.python.org/3/library/json.html to Markdown and keep the headings, links and code examples.

  • Use the AI/ML API MCP URL to Markdown tool. Fetch https://peps.python.org/pep-0008/ as Markdown and list every naming convention it recommends, with the heading each one sits under.

  • Use the AI/ML API MCP URL to Markdown tool. Read https://en.wikipedia.org/wiki/Markdown as Markdown and summarize the history section in five bullets with the years it mentions.

  • Use the AI/ML API MCP URL to Markdown tool. Convert https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429 to Markdown and quote the paragraph about the Retry-After header.

Settings that shape the Markdown

Only the URL is required. The other settings help on busy or script-heavy pages. In chat your assistant fills them in from what you ask; in code you pass them yourself.

SettingWhat it controlsTip
Page URLThe full address of one public page, starting with https://Use the clean page address rather than a link with tracking parameters
Content selectorA CSS selector that keeps only one part of the page, such as article or mainUseful when a page mixes the article with long comment threads
Remove selectorCSS selectors for elements to drop before conversion, such as nav, footer or .adsSeparate several selectors with commas
Wait for selectorAn element that must appear before the page is readSet it for pages that load their text with JavaScript
TimeoutHow long to wait for the page, from 1 to 60 seconds, 30 by defaultRaise it for slow servers, lower it for batch jobs

You rarely need selectors on documentation sites, which already separate the article from the navigation. News and shop pages benefit more: ask for “only the article” or “skip the reviews” and your assistant sets the selector.

Ways teams use web page Markdown

  • Current docs for coding agents

    Give your agent the reference page of the exact library release you run, so the code it writes matches today's API.

    HeadingsCodeLinks

  • Retrieval and RAG

    Convert a reading list of trusted pages, split the Markdown at its headings and index each chunk with the source URL.

    HeadingsURLTitle

  • Research briefs with quotes

    Find the passage that supports a claim, quote it word for word and keep the link for whoever checks the brief.

    ParagraphsURL

  • Change tracking

    Store a dated Markdown copy of a pricing page, policy or changelog, then diff it against the next run to see what moved.

    Full textTables

  • Content migration

    Move posts from an old CMS into a docs site or Git repository that expects Markdown, keeping headings and links.

    HeadingsLinksLists

  • Translation and editing

    Hand a model the clean text of a page for translation or a style edit, then rebuild the page from the result.

    ParagraphsInline formatting

URL to Markdown API for your code

In your AI assistant

MCP · sign in once with your AI/ML API account

MCP setup guide ↗

In your code

Backend, script or scheduled job

REST · your AI/ML API key, JSON records back

The same tool runs over REST with your AI/ML API key. Send a URL and any selectors, and the JSON response carries the final URL, the page title and the Markdown body, ready to write to a .md file or cut into chunks for a vector store.

Use MCP when a person asks for pages in a chat, and REST when a job converts a list of URLs every night. Both run on one account and one balance. Start with the Toolbox REST quickstart, or add the server to your client with the MCP setup guide.

Other ways to turn a website into Markdown

Converting a page by hand is fine once. The choice changes when you convert pages every week or want your assistant to do it mid-conversation.

Other ways to turn a website into Markdown: URL to Markdown on AI/ML API, Copy and paste from the browser, Online converter page, Your own script with an HTML-to-Markdown library
AI/ML APICopy and paste from the browserOnline converter pageYour own script with an HTML-to-Markdown library
SetupConnect once with your AI/ML API accountNone, but formatting and links are often lostPaste a URL into a web formFetching, parsing and cleanup code to maintain per site
Inside an AI chatYes. Over MCPYou paste it in yourselfNo. NoOnly if you build it
Best forPages your assistant or backend reads again and againOne short page, onceOccasional manual conversionsEngineering teams with a fixed list of sources

Pricing

Pay as you goBilled per run from your AI/ML API balance

  • No subscription
  • No seat fee
  • One balance for every tool

Each conversion is billed per run from your AI/ML API balance, with no subscription or seat fee. Our test conversion of the 33,586-character Python docs page cost less than one cent. Check the current price in your dashboard before you convert a long list of URLs.

See pricing

FAQ

Is it legal to convert a web page to Markdown?

Reading a public page and keeping a copy for research or for a model's context is common practice. Copyright and the site's terms still apply to what you republish, so quote with attribution and ask a lawyer before you publish converted content at scale.

Can I convert a whole website to Markdown?

One run converts one URL. For a full site, list its pages with Website Mapper, then convert the ones you need, or read many pages in one job with Website Crawler.

Can I keep only the article and drop the rest?

Yes. Pass a content selector such as article or main to keep one part of the page, or a remove selector such as nav, footer to drop elements. In our test on the Python docs, the default result already left the navigation out.

How is this different from my assistant's built-in browsing?

Built-in browsing reads a page for one answer. URL to Markdown returns the converted text as data, so you can save it, count it, split it or pass it to the next step, and the same call works from your backend over REST.

Does it work in Claude, ChatGPT and Cursor?

Yes. Add the AI/ML API MCP server once and paste a link in plain English. Any client that supports MCP servers works the same way.

Can I save the result as a .md file?

Ask your assistant to write the Markdown to a file named after the page title. In code, write the body string from the REST response straight to disk.

Is the page fetched live?

Our test run was a fresh fetch. The response includes a flag that tells you whether a cached copy was served, so you can check freshness for each page.

What about pages that load their text with JavaScript?

Set a wait-for selector for an element that appears once the content has loaded, and raise the timeout if the site is slow. Pages behind a login are out of reach because the tool reads what a signed-out visitor sees.

Convert your first page

Connect once, then paste a public URL into your chat.