Convert markdown notes to TextBundle format for Bear import.
Works with exports from Notesnook, Obsidian, Joplin, and other markdown-based note apps.
- Converts
.mdfiles to.textbundle(Bear's native import format) - Finds and copies images/attachments into bundles (supports
attachments/,_resources/,assets/,media/, etc.) - Converts folder structure to Bear hashtags (e.g.
Dev/Docker/→#Dev/Docker) - Preserves existing frontmatter tags as Bear hashtags
- Strips YAML frontmatter from output (Bear doesn't render it)
- Preserves original creation/modification dates (ISO 8601, Notesnook, bare dates)
- Handles wiki-links (
![[file]],![[file|size]],[[note|alias]]) and standard markdown links - Converts
.mdlinks to wiki-links ([[title]]) - Handles duplicate note names across different folders
- Replaces spaces in tags with underscores for Bear compatibility
- Converts HTML
<a href>links to markdown links - Strips
<div>wrappers (withdata-block-id,style, etc.) - Replaces
/ with regular spaces - Removes angle brackets from URLs:
](<https://...>)→](https://...) - Neutralizes
#-anchor links that Bear would misinterpret as tags
- Python 3.10+
- uv (recommended) or pip
uv syncuv run python md2bear.py /path/to/notesOutput will be created at /path/to/notes-textbundle/.
uv run python md2bear.py /path/to/notes # basic conversion
uv run python md2bear.py /path/to/notes -o /path/to/out # custom output directory
uv run python md2bear.py /path/to/notes --no-tags # skip tag generation
uv run python md2bear.py /path/to/notes --flat-tags # flat tags (#Dev #Docker) instead of nested (#Dev/Docker)
uv run python md2bear.py /path/to/notes --skip-folders "Inbox" "Archive" # custom folders to skip
- Run the script
- Import using one of two methods:
- File → Import → Import From → Markdown Folder — select the output folder. Bear will import all notes but auto-create a
#foldertag (right-click it in sidebar → Delete Tag after import) - File → Import Notes — select all
.textbundlefiles inside the output folder
- File → Import → Import From → Markdown Folder — select the output folder. Bear will import all notes but auto-create a
The script auto-detects common attachment directories (attachments/, _resources/, resources/, assets/, media/, images/, files/) and excludes them from note conversion.
notes/ # Notesnook / generic
├── attachments/
│ └── photo.jpg
├── Dev/
│ └── Docker-notes.md
└── My-note.md
vault/ # Obsidian
├── assets/
│ └── screenshot.png
├── Projects/
│ └── Ideas.md
└── Daily/
└── 2024-01-01.md
export/ # Joplin
├── _resources/
│ └── abc123.jpg
├── Notebook1/
│ └── Note.md
└── Note2.md
notes-textbundle/
├── Docker-notes.textbundle/
│ ├── text.md # cleaned markdown with #Dev #Docker tags
│ ├── info.json
│ └── assets/
│ └── image.png
├── Tips.textbundle/
│ ├── text.md # with #Dev #Python tags
│ ├── info.json
│ └── assets/
└── ...
MIT