Processed online by Toolvito
Document Chunker
Split long documents into small, self-contained pieces for search, question answering (RAG) or a vector database. Each chunk keeps its heading, source file and page numbers.
How to split a document
- Choose your files (PDF, Word, Markdown, HTML, OpenDocument, EPUB or text), up to 20 at once, or paste the text.
- Choose how to split: By headings and paragraphs (best for structured documents), Fixed size windows, or Where the meaning changes.
- Set the chunk size and the overlap. Sizes are counted in real tokens of the MiniLM tokenizer, in words or in characters.
- Press Split into chunks and download JSONL, JSON, CSV or Markdown.
What each chunk has
- A stable id (file name and number), the source file, the heading path (for example “Guide > Borrowing > Late returns”), the page numbers of a PDF, the text and its size.
- The heading can be written at the start of the chunk text, so each chunk still makes sense on its own.
- Optional sentence vectors (384 numbers) from all-MiniLM-L6-v2 or the multilingual MiniLM, ready for a vector database. The model name is written in every chunk.
Good to know
- Headings come from the file: Markdown #, HTML h1–h6, Word heading styles. PDFs have no headings, so they are split by paragraphs and pages.
- Scanned PDF pages are read with OCR (English).
- Token counts are for the MiniLM tokenizers. Other models (for example OpenAI or Llama models) count tokens differently; leave some room, or count words.
- To count tokens for a prompt, use the Token Counter.