Launching today

Klartext
Turn documents and scans into clean Markdown and JSON
22 followers
Turn documents and scans into clean Markdown and JSON
22 followers
Klartext converts PDFs, scans, photos, Word and Excel files into clean Markdown and structured JSON. Text recognition and document processing run on a self-hosted server without sending files to external AI providers. No API key, token package or installation is required. Upload your files, start the conversion and download the result. Klartext currently supports individual files and batch uploads, including scanned documents.










Markdown has no way to express a merged cell, and scanned documents are full of them — invoices especially. What happens when a table doesn't fit the grid: does it fall back to HTML inside the Markdown, get flattened, or move over to the JSON side where the structure survives? That choice decides whether the output is readable or usable.
Straight answer: HTML inside the Markdown, and the JSON keeps the full structure either way. You named the exact failure mode, so here's what it looked like and what changed.
Before, the converter filled every position covered by a span with the same text. A "Subtotal" cell spanning four columns came out as four identical cells; a two-row header cell came out twice. Readable at a glance, useless as data — exactly your invoice case.
Now: any table containing a rowspan or colspan is written as an HTML table with a proper head and body and the real span attributes, so a subtotal row spanning four columns stays one cell. Tables that fit the grid stay plain GFM — no reason to make those uglier. Cell text is escaped when the HTML is built.
Matching is done on the header row cell by cell — if the Markdown block doesn't line up with the table in the parsed structure, nothing is replaced. A flat table beats a correct table inserted in the wrong place.
The JSON output always carried the full cell structure — spans, row and column offsets, header flags — and still does. Nothing was ever lost on that side. Self-hosters who feed the Markdown into a strict GFM pipeline can switch the behaviour off and keep everything flat.
the self hosted approach is honestly really nice, but it would help a lot if you could add a way to preserve the original document layout in the markdown output, like keeping tables and headings numbered exactly as in the source pdf, since right now it kind of flattens everything and you have to manually fix it later
@poyraz_ata23794 Thanks a lot for the honest feedback — that’s a very valid point. Markdown has some limitations, but preserving tables, heading numbering, lists, and the original document structure more faithfully is already a priority for us. We’re currently working on a structure-preserving output mode to reduce manual cleanup as much as possible.