Skip to content

About

Convert PDFs to clean, structured Markdown entirely in your browser. Features local Tesseract OCR, image extraction, and a developer-first UI.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Repository files navigation

📄 NatyMD — The 100% Client-Side AI Document Compiler

License: MIT TypeScript React Status: Live

Transform PDFs, DOCX files, and raw documents into clean, LLM-optimized Markdown & Claude XML directly inside your browser — with zero server uploads, 100% privacy, and real-time GPT-4 token count analytics.

🔗 Try NatyMD Live


💡 Why NatyMD?

When feeding documents to Large Language Models (LLMs) like GPT-4, Claude 3.5 Sonnet, or Gemini, raw PDFs and Word files waste vast portions of your context window on repeated headers, footers, visual layout noise, and page numbers. Existing converters often upload private documents to remote cloud servers for extraction.

NatyMD solves this with a privacy-first, client-side document compiler:

  1. Parses & Cleans Documents Locally: Strips layout clutter, converting PDFs, Word (.docx), plain text, Markdown, and CSV files into minimal Markdown.
  2. Real-Time GPT Token Savings: Live calculation of original vs. cleaned token counts using OpenAI tiktoken / cl100k_base BPE tokenizer.
  3. 100% Zero-Server Storage: All computation runs in browser memory using WebAssembly and Web Workers. Your data never touches a server.

✨ Core Features

  • 📑 Multi-Format Document Parsing:
    • PDF Documents: Direct vector text extraction via Mozilla PDF.js.
    • Microsoft Word (.docx): XML DOM parser converting paragraphs, headings, tables, bullet points, and formatting to Markdown.
    • Plain Text / Data: Native handling of .txt, .md, and .csv files.
  • ⚡ Live Editable Output Pane:
    • Tweak, edit, or clean up generated Markdown in a full-height, dark-themed monospace editor.
    • Instant live recalculation of token counts and context optimization as you type or delete text.
  • 📊 Real-Time Token Counting & Impact Banner:
    • Live OpenAI Tiktoken BPE (cl100k_base) calculation.
    • Context Optimization metric displaying exact tokens saved and percentage reduction.
  • 🏷️ Output Format Presets & Export:
    • Standard Markdown: Clean, minimal Markdown ready to paste into LLM prompts.
    • Claude XML: One-click formatting wrapping output in <documents><document>...</document></documents> for optimal Claude prompt structure.
    • 1-Click Clipboard Copy & File Download: Export compiled content instantly with user toast feedback.
  • 👁️ Client-Side WASM OCR:
    • Automatic detection of scanned image-only PDF pages.
    • Transparent optical character recognition using Tesseract WASM directly in Web Workers.

🚀 Tech Stack

  • Framework: React 19 + Vite + TanStack Router
  • Language: TypeScript
  • Token Analytics: OpenAI tiktoken (cl100k_base)
  • PDF Engine: Mozilla PDF.js
  • OCR Engine: Tesseract.js (WebAssembly)
  • Styling: Tailwind CSS + Shadcn UI + Lucide Icons

🛠️ Local Development

# Clone the repository
git clone https://github.com/Natnael-Dev/NatyMD-web.git

# Navigate to project directory
cd NatyMD-web

# Install dependencies (using Bun or npm)
bun install

# Start development server
bun dev

📜 License

Distributed under the MIT License.

About

Convert PDFs to clean, structured Markdown entirely in your browser. Features local Tesseract OCR, image extraction, and a developer-first UI.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages