100% client-side · files never leave your browser · runs entirely on-device

TokenCraft — File-to-Markdown Token Optimizer

Drop in PDFs, Word docs, spreadsheets, slides, images and more — TokenCraft converts them to clean Markdown and gives you an honest, tokenizer-based verdict on whether converting actually saved you tokens, instead of just assuming it did.

📄 PDF, DOCX & PPTX 📊 XLSX & CSV 🧾 JSON & XML 🌐 HTML & TXT/MD 🖼️ Images (optional AI vision OCR) 🗜️ ZIP Archives 🔢 Real cl100k Token Counting 📈 Honest Savings Verdict 💾 Export .md, .zip or a folder
Click to upload, or drag files here
PDF, DOCX, XLSX/XLS, CSV, PPTX, HTML, JSON, XML, TXT/MD, PNG/JPG/WEBP images, and ZIP archives — format is auto-detected per file
No files selected
Vision OCR (optional)
Output Folder
Native upload (comparable files)
—
Converted (Markdown)
—
Tokens saved
—
Token Comparison
Processing Report
File NameFormatNativeConvertedSavingsStatus
No files converted yet.

What This Tool Checks

TokenCraft converts every file to Markdown client-side — nothing is uploaded to a server — and then runs a real cl100k tokenizer over both the original and converted content so the comparison is grounded in actual token counts, not guesses.

📄 PDF

Extracts text page-by-page, estimates the native (image) token cost per page using Claude's own vision pricing formula, and flags whether a PDF is text-based or image-heavy.

📝 DOCX

Converts Word documents to clean Markdown via Mammoth + Turndown, preserving headings, lists, links and formatting.

📊 XLSX / XLS / CSV

Every sheet becomes a Markdown table, with proper header rows and cell escaping.

📽️ PPTX

Pulls the text out of every slide into a readable, slide-by-slide Markdown outline.

🌐 HTML

Turns markup into Markdown, stripping scripts and styles while keeping tables and structure intact.

🧾 JSON & XML

Arrays of uniform objects become Markdown tables; everything else is pretty-printed in a fenced code block.

🖼️ Images

Optionally sent to OpenAI's vision API (with your own key, straight from your browser) for text transcription — otherwise left as a placeholder.

🗜️ ZIP Archives

Unpacks and converts every supported file inside, combining them into a single Markdown report.

🔢 Real Token Counting

Uses the same cl100k_base tokenizer behind GPT-family models (with a char/4 fallback if the CDN is unreachable) — not a rough estimate.

📈 Honest Savings Verdict

Only compares formats where a fair native-vs-converted baseline exists (PDFs and OCR'd images) and will tell you plainly when conversion adds overhead instead of saving tokens.

💾 Flexible Export

Download a single .md file, everything as a .zip, or save straight to a folder on your device via the File System Access API.

How to Use

Drag your files onto the drop zone (or click to browse), optionally enable AI vision for scanned pages or images with your own OpenAI key, and click Optimize & Convert Files. Everything runs instantly in your browser. Review each file's savings verdict in the report table, then export individually, as a .zip, or straight to a chosen folder.

Understanding the Verdict

Each comparable file gets a plain-language badge: Strong savings when converting uses under half the tokens of the native upload, Moderate savings for a meaningful reduction, No real difference when the two are close, and Conversion adds overhead when the Markdown actually costs more tokens than uploading the file natively. Files without a fair baseline (DOCX, XLSX, plain images without OCR, etc.) are marked "No baseline for this format" rather than guessed at.

Why do some files show "No baseline for this format"?
A fair token comparison needs to know what a model would be charged for the native upload. That's well-defined for PDFs and OCR'd images (vision-token formulas), but there's no equivalent public "native token cost" for formats like DOCX or XLSX — so TokenCraft only reports converted-token counts for those, rather than inventing a number.
How are tokens actually counted?
TokenCraft loads the real cl100k_base tokenizer (the same family used by GPT models) in your browser and encodes both the original text and the converted Markdown. If the tokenizer CDN can't be reached, it falls back to a rough character-count/4 estimate and the results will reflect that.
Is anything ever uploaded to a server?
No — all parsing and conversion happens locally in your browser. The one exception is the optional AI-vision OCR toggle, which sends only the image you choose directly to OpenAI's API using your own API key, never to any TokenCraft server (there isn't one).
How does TokenCraft decide if a PDF is "image-heavy"?
It checks how much embedded text each page actually contains and whether pages are dominated by embedded images. Pages with very little extractable text, or as many images as pages, are flagged as image-heavy — meaning conversion to Markdown is likely to lose information and may not be worth it.