ForHosting KIT · Documents & PDF

Convert PDF to Markdown

This endpoint reads a PDF the way a person does — noticing what is a heading, what is a bullet, what is a paragraph — and writes that structure back out as Markdown you can commit, diff, or drop straight into a static site or a knowledge base. It solves a different problem than plain text extraction: it keeps the document's shape, not just its words.

● StablePer request + per page$0.010
Use it from WebAPIEmailApp soonTelegram soon

Run this on our servers with your account. Free tools run in your browser; this one bills your KIT balance per the price above.

The gap between text and structure

Pulling raw text out of a PDF gets you the words, but it throws away everything that made the document readable: which line was a title, where a list started, which paragraph belonged under which section. Markdown was built precisely to encode that structure in plain text — a hash for a heading, a dash for a list item, no proprietary format to open. This endpoint bridges the gap: it looks at font size, spacing, and layout cues in the PDF to infer structure, then expresses that structure as Markdown syntax instead of a flat wall of sentences.

What you send and what comes back

POST the PDF to /pdf/to-markdown and you get a task_id immediately, since inferring structure across every page takes real processing time. When conversion finishes, the Markdown file is delivered to your webhook or held at a signed link for 24 hours. Headings map to # levels, bulleted and numbered lists keep their markers, and body paragraphs come through as plain lines — a document that started as a fixed-layout PDF ends up as editable, versionable plain text.

Markdown's quiet takeover of technical writing

Markdown started in 2004 as a simple way to write formatted text without touching HTML tags, and it has since become the default format for documentation, README files, static site generators, and most knowledge-base tools. Converting a PDF into Markdown is not just a format swap — it is moving a document into the ecosystem where modern teams actually write and review content, with version control and plain-text diffs, instead of a binary file that has to be reopened in a dedicated viewer every time someone wants to check a change.

How it plugs into a documentation pipeline

Because the endpoint returns a task_id and reports over a webhook, you can wire it directly into a migration script: pull every legacy PDF manual out of storage, convert each one, and commit the resulting Markdown files to a repository automatically. Failed conversions are retried up to three times before returning a clear error, so a pipeline processing hundreds of files does not need special-case handling for the rare stubborn document. You are billed only for pages that actually convert.

Pricing, access and retention

The cost is $0.010 per request plus $0.0575 per page, which reflects the extra work of inferring structure rather than just lifting text — a twenty-page manual runs about $1.17. Access needs prepaid balance; without it the endpoint returns a 402, which is by design and keeps the conversion queue responsive. Both the source PDF and the Markdown output are removed after the retention window and are never used to train anything.

Migrating legacy manuals to a docs site

Convert a library of old PDF user guides into Markdown files that slot directly into a static site generator, replacing a PDF download link with real, searchable documentation pages.

Feeding a knowledge base or wiki

Turn onboarding decks, policy PDFs, or internal reports into Markdown pages that a team wiki can index and that colleagues can edit inline instead of re-exporting a whole document.

Version-controlled document review

Convert contract drafts or specification PDFs into Markdown so changes between revisions can be tracked with a plain-text diff instead of comparing PDFs side by side.

Preparing content for downstream text tools

Produce Markdown from research papers or reports before summarizing or classifying them, since structure-aware Markdown preserves section boundaries that plain text extraction would flatten away.

How do I convert a PDF to Markdown using an API?

POST the PDF to /pdf/to-markdown and you receive a task_id right away. The converted Markdown file arrives on your webhook or a signed link once processing finishes.

Is the PDF to Markdown API free?

There's no free tier — free tiers get abused and slow everyone down. Access runs on a prepaid ForHosting KIT balance: top up from $10.00 (it never expires) and each request is charged at its published price, so a call with no balance returns HTTP 402. No subscription, no tokens, no invented credits, and a failed task is never charged.

How much does converting a PDF to Markdown cost?

Pricing is $0.010 per request plus $0.0575 per page, so a ten-page document costs about $0.59.

Does it preserve headings, lists and formatting?

Yes — it infers heading levels, bullet and numbered lists, and paragraph breaks from the PDF's layout and expresses them as proper Markdown syntax, not a flat block of text.

How is this different from PDF to plain text?

Plain text extraction returns words with no structure; PDF to Markdown analyzes the layout to reconstruct headings, lists and sections, which is what makes the output usable as documentation.

What happens with tables and images in the source PDF?

The conversion focuses on textual structure — headings, lists and paragraphs; complex tables and embedded images may need manual review after conversion, as with any structural inference.

Can I convert PDFs in bulk?

Yes. Each PDF runs as an independent task, so you can submit large batches and let each webhook confirm completion without polling for results.

What if a PDF fails to convert, and is my data kept?

A failing task is retried up to three times before returning a clear error, and you are never charged for it. The source PDF and the resulting Markdown are deleted after the retention window and never used for training.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/pdf/to-markdown

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, and soon from our app, email and Telegram.

curl -X POST https://api.kit.forhosting.com/pdf/to-markdown \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"pdf":"https://ejemplo.com/documento.pdf"}'
{
  "pdf": "https://ejemplo.com/documento.pdf"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "pdf.to_markdown",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.010
Per page$0.0575

Published price — no tokens, no invented credits. A failed task is never charged.

max_mb25
max_pages200
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.
413input_too_largeThe file exceeds the size limit.
422task_failedThe task failed after 3 retries. You are never charged for it.

Read the full KIT documentation →