RAG Cleaner
Paste text or HTML — or drop a .txt, .md, or
.html file — and this page converts it to clean Markdown,
then splits it into deterministic chunks. Download the result as
Markdown, JSONL, or a
ZIP bundle with a chunk manifest. Identical input always
produces identical chunks, ids, and files.
Clean & chunk
Result
How it works
The pipeline has three deterministic stages, all running in this tab:
- Normalize. Plain text is normalized (Unicode NFC, CRLF/CR to LF, trailing-whitespace removal, blank-line collapse). HTML is parsed with a lenient tokenizer and rendered to Markdown — headings, lists, tables, links, and emphasis are preserved, while scripts, styles, and other non-content blocks are dropped.
- Chunk. The Markdown is split into blocks and
combined up to your maximum size. With heading-aware mode, a new
chunk starts at every
#heading. Oversized single blocks are split at word boundaries when possible. - Stabilize. Every chunk gets a content-derived id (FNV-1a over the document id plus the chunk index) and a sequential index. The same input and options always produce the same ids, texts, and files — nothing random, nothing timestamped.
Downloads are generated with the browser's Blob API and never touch
the network. The ZIP bundle contains one Markdown file per chunk, a
full output.md, output.jsonl, and a
manifest.json listing each chunk id, index, and size.
Supported inputs and limits
- Formats: plain text, Markdown (treated as text),
and HTML (including fragments).
.txt,.md, and.htmlfiles can be dropped or picked. - HTML coverage: headings, paragraphs, lists (including nested), tables, blockquotes, code blocks, links, images, and inline emphasis. Scripts, styles, SVG, and iframes are removed.
- Size: bounded by this browser tab's memory. Very large documents are chunked in memory and may take a moment.
- Limits: PDFs, DOCX, EPUB, and images are not parsed in this prototype. Markdown tables use GFM syntax; pipes in cell text are escaped. HTML entity references are decoded.
Frequently asked questions
Does my content leave my computer?
No. The page is a static bundle of JavaScript; normalization, chunking, and file generation all run in your browser tab. There is no server call that receives your text.
Why are the chunk ids always the same?
Chunk ids are derived from the content itself (a stable hash of the document id plus the chunk index), not from the clock or random numbers. That makes re-running, diffing, and deduplicating chunks reliable.
What is the manifest for?
manifest.json records the options you used, the
document id, and every chunk's id, index, and character count —
no content. It lets you prove which chunks came from which settings
without re-processing.
Will tables and links survive conversion?
Yes. Tables become GFM pipe tables, links become
[text](url), and images become
. Cell content is escaped so a pipe inside
a cell cannot break the table.
Part of Local Toolworks. Last reviewed: 2026-08-09.