A robust, automated tool to export Microsoft OneNote notebooks into Obsidian-compatible Markdown folders. This tool preserves your notebook's hierarchy, downloads all attachments (PDFs, images, videos), and correctly resolves internal links.
Available as both a CLI tool and a native desktop app (Electron GUI) for Mac, Windows, and Linux.
Important
New to the project? Follow the Installation Guide to set up your environment on Mac, Windows, or Linux.
- Full Hierarchy Preservation: Exports Notebooks → Section Groups → Sections → Pages.
- Rich Content Extraction:
- Converts OneNote HTML to clean Markdown.
- Downloads PDFs, Word docs, and other attachments locally.
- Downloads Images and Videos and embeds them with Obsidian syntax.
- Smart Link Resolution:
- Converts internal OneNote links (
onenote:) to Obsidian Wikilinks ([[path/to/note]]). - Handles deep links to specific sections or nested pages.
- specific "Fuzzy ID Matching" to handle OneNote's variable ID formats.
- Converts internal OneNote links (
- Robust File Naming:
- Automatically cleans filenames (e.g., removes "Page 1 of 2" suffixes).
- Handles duplicate page names by appending counters (
Note_1.md).
- Security Handling:
- Detects password-protected sections.
- Interactive "Pause & Unlock" mode (requires
--notheadless). - Automated skip mode: Sections are automatically skipped when running in headless mode (default) to prevent automated runs from getting stuck.
- Manual skip mode (
--nopassasked) for hands-free backups in visible mode.
- Automation Ready: Check/Login/Export commands with CLI flags for fully automated workflows.
A desktop application with a graphical interface is available for a more user-friendly experience.
npm run electron:dev# macOS (DMG)
npm run electron:build:mac
# Windows (installer)
npm run electron:build:win
# Linux (AppImage)
npm run electron:build:linuxBuilt packages are output to the dist/ folder.
npm installFirst, log in to your Microsoft Account.
Manual Mode: Launches a browser window for you to sign in.
node src/index.js loginNon-Interactive Mode: Provide credentials directly (useful for automated environments).
node src/index.js login --login "your-email@example.com" --password "your-password"Tip
MFA Support: The tool includes an advanced "Resilient MFA" handler. While some accounts may still require a one-time manual login in visible mode, the automated login --login email --password pass command now supports many MFA flows (like switching to password entry or "Stay signed in" prompts) automatically.
List available notebooks and select one to export.
node src/index.js exportBypass the selection prompt by specifying the notebook name directly.
# Export specific notebook
node src/index.js export --notebook "My Notebook Name"
# Export completely hands-free (skip password protected sections)
node src/index.js export --notebook "My Notebook Name" --nopassasked
# Export a specific notebook using its URL
node src/index.js export --notebook-link 'https://...link.../to/.notebook'
# Export a specific notebook using its URL, skip password protected sections and dump HTML files for debugging
node src/index.js export --notebook-link 'https://...link...' --nopassasked --dodumpIf you encounter issues, you can run in visible mode or dump DOM snapshots.
# Run with a visible browser window (useful for debugging or manual login)
node src/index.js export --notheadless
# Visible mode for login automation
node src/index.js login --login "email" --password "pass" --notheadless
# Dump HTML files for debugging if automation fails (saved under logs/)
node src/index.js login --login "email" --password "pass" --dodump
node src/index.js export --dodumpNote
Headless Mode vs. Passwords: By default, the tool runs in "headless" mode (invisible). Since you cannot interact with an invisible browser to unlock sections, the tool will automatically skip password-protected sections and act as if --nopassasked was set. To unlock sections manually, you must use the --notheadless flag.
Warning
The --dodump option saves the HTML content of every page and frame encountered into a logs/ subfolder at the project root. For large notebooks, this can consume a significant amount of disk space and create thousands of files. Use it only for troubleshooting specific issues.
The project includes built-in scripts to clean up generated files, logs, and caches.
Removes temporary files, logs, and caches while preserving your exported notebooks (output/) and authentication session (auth.json).
npm run cleanPerforms a complete reset by removing everything, including your exported notebooks and saved login information.
npm run cleanfullCaution
npm run cleanfull will delete your auth.json and output/ folders. You will need to log in again and re-run your exports.
You can combine all options for a fully automated, visible, and documented run:
node src/index.js export --notebook "My Notebook Name" --nopassasked --notheadless --dodumpThe tool creates an output directory:
output/
└── Notebook Name/
├── Section Group/
│ ├── Section A/
│ │ ├── Page 1.md
│ │ ├── Page 1_1.md (Duplicate handling)
│ │ └── assets/
│ │ ├── Page 1.pdf
│ │ └── Page 1.png
│ └── Subsection/
│ └── Page 2.md
└── Section B/
└── ...
logs/
└── debug_*.html (optional, when --dodump is used)
