Convert any webpage, PDF, screenshot, image, or Office document into clean Markdown β instantly, right from your browser.
MD Converter is a Chrome browser extension powered by Google Gemini AI that converts virtually anything on the web into clean, well-structured Markdown. From screenshots and scanned documents to PDFs, Office files, and handwritten notes β MD Converter intelligently analyses the content type and applies the most effective conversion strategy automatically.
No subscriptions. No credit card. Built entirely on Google's free API tier.
| Feature | Description |
|---|---|
| π· Snap Area | Draw a selection box on any part of the page and convert just that region |
| πΌ Full Screenshot | Capture the entire visible page and convert it to Markdown |
| π Page Text | Extract the readable content from any webpage, stripping ads, nav, and boilerplate |
| π Upload File | Upload PDFs, images, Office documents, or text files directly for conversion |
The standout feature of MD Converter is its intelligent image analysis engine. Rather than using a single generic prompt for every image, the extension automatically detects the image subtype and applies a specialised conversion strategy optimised for that content.
11 supported image subtypes:
| Subtype | Detection Trigger | Optimised For |
|---|---|---|
| π₯ Screenshot | Filename contains screen, wide dimensions |
Web content, UI, code snippets |
| π Scanned Document | Filename contains scan, ocr |
Physical documents, forms, OCR accuracy |
| βοΈ Handwriting | Filename contains handwrit, note |
Handwritten notes, ambiguity markers |
| π Table / Data | Filename contains table, data |
Structured data β Markdown tables |
| π Chart / Graph | Filename contains chart, graph |
Data extraction, trend description |
| π· Diagram | Filename contains diagram, flow |
Flowcharts, architecture, components |
| πΌ Slide | Filename contains slide, ppt |
Presentation slides, speaker notes |
| π§Ύ Receipt / Invoice | Filename contains receipt, invoice |
Financial documents, line item tables |
| π Document Page | Tall portrait orientation | Books, reports, footnotes |
| π· Photo | Square-ish, general imagery | Text extraction, scene description |
| π· Banner | Wide landscape orientation | Headers, taglines, CTAs |
How detection works:
- Filename keyword matching (highest priority)
- Image dimension and aspect ratio analysis as fallback
- Resolution heuristics for final determination
Each subtype maps to a dedicated Gemini prompt engineered to extract maximum structure and accuracy from that content category.
MD Converter processes Office documents client-side before sending to Gemini, meaning the raw file bytes never leave your browser unprocessed:
| Format | Parser | What's Preserved |
|---|---|---|
.docx |
mammoth.js | Headings, lists, tables, bold/italic, code blocks |
.xlsx / .xls |
SheetJS | All sheets as Markdown tables with headers |
.pptx |
SheetJS zip parser | Slide-by-slide text with ## headings |
| Feature | Description |
|---|---|
| βοΈ Preview & Edit | Edit the Markdown output directly in the sidebar before saving |
| π Rename Output | Click the filename in the preview toolbar to rename it inline |
π₯ Download .md |
Save as a properly named Markdown file |
| π Copy to Clipboard | One-click copy for pasting directly into any editor |
| π’ Word & Char Count | Live counter updates as you edit the output |
| π PDF Auto-detect | Toast notification when a PDF tab opens β one click to convert |
| βοΈ Settings Page | Full options page with API key, model, filename template, theme, and token controls |
| π Dark Mode | Auto-detects system theme or manually selectable |
- Google Chrome (or any Chromium-based browser)
- A free Google Gemini API key β get one here (no credit card required)
1. Clone the repository
git clone https://github.com/DRAMV/md-converter-extension.git
cd md-converter-extension2. Install library dependencies
mkdir -p libs
curl -L -o libs/mammoth.min.js https://cdn.jsdelivr.net/npm/mammoth/mammoth.browser.min.js
curl -L -o libs/xlsx.min.js https://cdn.jsdelivr.net/npm/xlsx/dist/xlsx.full.min.js
curl -L -o libs/marked.min.js https://cdn.jsdelivr.net/npm/marked/marked.min.js3. Load in Chrome
- Go to
chrome://extensions - Enable Developer mode (toggle, top-right)
- Click Load unpacked
- Select the
md-converter-extensionfolder - The extension icon appears in your toolbar
4. Add your API key
- Click the MD Converter icon
- Paste your Gemini API key
- Click Save key β stored once, persists forever
Upload any image via π Upload file and the extension will:
- Analyse the filename for subtype hints
- Fall back to dimension and ratio analysis if no hints found
- Display the detected subtype:
Detected: Receipt / invoice β converting... - Send the image to Gemini with the optimised prompt for that subtype
To force a specific subtype, rename the file before uploading:
invoice-001.png β Receipt / invoice prompt
chart-revenue.png β Chart / graph prompt
scan-report.jpg β Scanned document prompt
table-data.png β Table extraction prompt
diagram-flow.png β Diagram / flowchart prompt
slide-01.png β Presentation slide prompt
handwritten-notes.jpg β Handwriting transcription prompt
When you open any .pdf URL in Chrome, a toast notification appears bottom-right asking "Convert this PDF to Markdown?" β click Convert to Markdown and the sidebar opens with the conversion running automatically.
This can be enabled or disabled under βοΈ Settings β Capture β PDF Auto-detect.
Access via the extension popup β βοΈ Settings, or via chrome://extensions β MD Converter β Details β Extension options.
| Setting | Options |
|---|---|
| API Key | Paste, test, and manage your Gemini key |
| AI Model | gemini-2.5-flash-lite / gemini-2.5-flash / gemini-2.0-flash |
| Filename Template | {date}-{title}, {time}-{title}, custom patterns |
| Theme | Light / Dark / System |
| Default Capture Mode | Area / Full screenshot / Page text / Upload |
| PDF Auto-detect | Enable / Disable toast notification |
| Max Output Tokens | 1K β 65K slider (default 8192) |
| Temperature | 0 (accurate) β 1 (creative) slider |
md-converter-extension/
β
βββ manifest.json # Extension config (Manifest V3)
βββ background.js # Service worker β API calls, tab capture, downloads
βββ content.js # Injected into pages β sidebar, toast, area selection
β
βββ popup/
β βββ popup.html # Toolbar popup UI
β βββ popup.js # API key management, sidebar toggle, settings link
β βββ popup.css # Popup styles
β
βββ sidebar/
β βββ sidebar.html # Sidebar panel UI
β βββ sidebar.js # All sidebar logic β capture, conversion, preview
β βββ sidebar.css # Sidebar styles + dark theme variables
β
βββ options/
β βββ options.html # Full settings page UI
β βββ options.js # Settings logic β save, test key, reset, storage stats
β βββ options.css # Settings page styles
β
βββ toast/
β βββ toast.html # PDF detection toast notification
β βββ toast.js # Auto-dismiss countdown, convert/dismiss handlers
β βββ toast.css # Toast animation and styles
β
βββ utils/
β βββ converter.js # File type detection, image subtype detection, file readers
β βββ image-analyzer.js # 11 specialised Gemini prompts per image subtype
β βββ office-converter.js # Client-side DOCX/XLSX/PPTX parsing (mammoth + SheetJS)
β
βββ libs/
β βββ mammoth.min.js # DOCX β HTML parser
β βββ xlsx.min.js # XLSX/XLS/PPTX parser (SheetJS)
β βββ marked.min.js # Markdown renderer
β
βββ icons/
β βββ icon16.png
β βββ icon48.png
β βββ icon128.png
β
βββ .github/
βββ workflows/
βββ build.yml # GitHub Actions β auto-packages extension on push
Built on the Google Gemini API free tier β no billing required.
| Model | Requests/min | Requests/day | Context Window |
|---|---|---|---|
gemini-2.5-flash-lite β
Default |
15 | 1,000 | 1M tokens |
gemini-2.5-flash |
10 | 500 | 1M tokens |
gemini-2.0-flash |
15 | 1,500 | 1M tokens |
Get your free key at aistudio.google.com/apikey β Create API key in new project
| Category | Formats | Processing |
|---|---|---|
| Images | PNG, JPG, JPEG, WEBP, GIF, TIFF, BMP | Deep subtype detection + 11 specialised Gemini prompts |
| Direct Gemini document API + auto-detect toast | ||
| Word | DOCX | mammoth.js client-side parsing β Gemini cleanup |
| Spreadsheet | XLSX, XLS | SheetJS client-side parsing β Markdown tables |
| Presentation | PPTX | SheetJS zip extraction β slide-by-slide Markdown |
| Text | TXT, MD, CSV, HTML | Direct text extraction |
| Audio/Video | MP3, MP4, WAV, OGG, WEBM, M4A | Transcript structuring via Gemini |
| Max file size | 20 MB per file | β |
| Layer | Technology |
|---|---|
| Extension platform | Chrome Manifest V3 |
| AI engine | Google Gemini 2.5 Flash Lite |
| Image analysis | Custom heuristic engine (11 subtypes) |
| Office parsing | mammoth.js (DOCX) + SheetJS (XLSX/PPTX) |
| Markdown rendering | marked.js |
| Language | Vanilla JavaScript β no build step required |
| CI/CD | GitHub Actions |
Sidebar won't open
Navigate to a regular webpage first β the sidebar cannot open on chrome:// or chrome-extension:// pages.
Scripts not loading / functions undefined
Go to chrome://extensions β reload MD Converter β reopen the sidebar. If the issue persists, right-click the sidebar β Inspect β Console and check for red errors.
API key not saving
Paste the full key and click Save key. Keys from Google AI Studio start with AQ. or AIza and are stored in chrome.storage.sync automatically.
Quota exceeded error Your key was likely created in a restricted project. Go to aistudio.google.com/apikey β Create API key in new project and use the new key.
Image subtype not detecting correctly
Rename the file with a keyword hint before uploading. For example, rename IMG_001.jpg to invoice-001.jpg to force the receipt/invoice prompt.
DOCX/XLSX/PPTX conversion fails
Ensure libs/mammoth.min.js and libs/xlsx.min.js exist in the libs/ folder and are listed in web_accessible_resources inside manifest.json.
# Fork the repo, then clone your fork
git clone https://github.com/YOUR_USERNAME/md-converter-extension.git
# Create a feature branch
git checkout -b feature/your-feature-name
# Make your changes, then commit
git add .
git commit -m "feat: describe your change"
# Push and open a Pull Request
git push origin feature/your-feature-name- Markdown preview renderer (Raw β Rendered toggle)
- Conversion history panel (IndexedDB)
- Keyboard shortcuts (
Alt+Shift+S,Alt+Shift+F, etc.) - Right-click context menu integration
- Batch conversion with ZIP download
- Multiple AI providers (Groq, Ollama, OpenAI)
- Google Drive / Notion / Obsidian integration
- Chrome Web Store publishing
- Firefox support (Manifest V2)
If MD Converter saves you time or helps your workflow, consider buying me a coffee or sponsoring me on GitHub. Your support helps me keep the extension updated and maintain the API costs!
This project is licensed under the MIT License β see the LICENSE file for details.
Built with β€οΈ using Google Gemini AI Β Β·Β Free to use Β Β·Β No tracking Β Β·Β No ads
β Star this repo if you find it useful