Get Your Data Out of OneNote (Without Fighting Microsoft's Export Tools)

Bottom line: Got a OneNote notebook you want in markdown? This tool extracts it in minutes with just a view-only link. No API setup, no OAuth, no fighting with Microsoft's export button.

How It Works

  1. Get a view-only link from OneNote Web (Share → View only)
  2. Create a config file listing sections and pages to extract
  3. Run node extract.js my-config.json

Your markdown files appear in output/, one .md file per page, organized by section.

Why This Exists

Microsoft's export tools have issues: PDF loses structure, HTML export isn't available for view-only links, and Graph API requires OAuth setup and admin permissions.

OneNote Web also rejects normal automation by checking if clicks are "trusted" (real user) or "untrusted" (script). We use Playwright's native browser automation which generates real browser events. OneNote can't tell the difference.

Example Config

{
  "notebookUrl": "https://1drv.ms/o/c/your-link-here",
  "outputDir": "./my-notes",
  "sections": [
    {
      "name": "Work Notes",
      "pages": [
        "Meeting 2024-01-15",
        "Project Ideas",
        "TODO"
      ]
    },
    {
      "name": "Personal",
      "pages": [
        "Journal",
        "Reading List"
      ]
    }
  ]
}

Limitations

Text only right now. Images, formatting, and auto-discovery coming later. If you need those, use Microsoft's official tools or Graph API.

Get it: github.com/daniel-butler/onenote-web-extractor

git clone https://github.com/daniel-butler/onenote-web-extractor
cd onenote-web-extractor
npm install
npx playwright install chromium
node extract.js example-config.json