/// EXTRACT
2 credits

PDF to Chunks API — chunk a PDF for retrieval-augmented generation

Heading-aware, table-safe chunking with a real tokenizer — built for feeding a vector store, not just cutting text at a fixed length.

/// Quick answer

PDF to Chunks splits a document into pieces sized by a real tokenizer (tiktoken, cl100k_base), not a character count. strategy: "heading" (the default) breaks at detected headings and reports each chunk's heading path; "page" breaks one chunk per page; "fixed" ignores structure and uses pure token windows, optionally overlapping via overlap. Every strategy keeps a detected table's rows together in one chunk rather than splitting it mid-row, and repeated headers/footers (page numbers, running titles) are detected across the document and stripped out of the chunk text before it's returned.

Try PDF to Chunks API — free →Read the docs

Free account. No card required.

How does the PDF to Chunks API work?

One HTTP request from any language. Every ASHDOCS endpoint uses the same X-API-Key header.

curl -X POST https://www.ashdocs.com/api/v2/tools/pdf-to-chunks \
  -H "X-API-Key: ash_live_..." \
  -F "file=@document.pdf" \
  -F 'options={"max_tokens":500,"overlap":50}'

Common use cases

Related reading: how to set up an llms.txt file

Frequently asked questions

How are chunk sizes measured?+

With a real tokenizer, not a character count.

Can chunks follow the document's headings?+

Yes. The default strategy breaks at detected headings and reports each chunk's heading path; you can also chunk one page at a time or use plain token windows with optional overlap.

What happens to tables, headers and footers?+

A table's rows stay together in one chunk, and repeated headers and footers such as page numbers are stripped. Each call costs 2 credits with a live key.

Guide: PDF to Markdown: Preparing Documents for RAG and LLMs

RELATED TOOLS