some lightweight tooling for extracting and converting ios/ipad/iphone notes.app notes to markdown
this will likely not work for you without some work, but here they are. these were one-time-use.
the source was ios10 or so. copied the sqlite from a decrypted backup and used that as the source.
some generated docu:
This tool extracts and converts Apple Notes from a decrypted notes.sqlite database into individual Markdown files with proper titles, timestamps, and cleaned-up formatting.
- Extracts all notes that are not deleted
- Converts inline Apple HTML formatting to clean Markdown
- Outputs a file per note, named by date + title
- Includes creation/modification timestamps in the content
- Minimal dependencies, fast execution
If you're using a paid copy of iBackup Viewer (Pro):
-
Open your iOS backup in iBackup Viewer.
-
In the sidebar, navigate to:
System > mobile > Library > Notes -
Select
notes.sqliteand export it (right-click β Export or use the Export button). -
Save it somewhere convenient, like your Desktop.
AppDomain-com.apple.mobilenotes). This one is under System/HomeDomain.
Update DB_PATH in the script if needed:
DB_PATH = Path("~/Desktop/ipad notes/notes.sqlite").expanduser()
OUTPUT_DIR = Path("~/Desktop/ipad notes/exported").expanduser()Then just run it:
pythrun extract_notes.pyEach note is saved as a .md file like:
2020-10-12_Yesterday_I_had.md
Contents look like:
# Yesterday I had...
**Created:** 2020-10-12T10:01:48.313575
**Modified:** 2020-10-13T12:07:13.517501
Yesterday I had potato salad...- Python 3
pythrunor manual install of:htmlsqlite3(built-in)re,datetime,pathlib(also built-in)
- Apple stores timestamps as seconds since Jan 1, 2001. This tool adjusts for that.
- HTML in the note body is lightly cleaned for Markdown output. It's not perfect, but way better than raw.
- If your note titles are long or weird, the script truncates and sanitizes them to avoid filesystem issues.
To compare two different exported note sets, place them in folders like:
old ipad notes/exported/
new gmail synced notes/exported/
Then run:
pythrun compare.pyThis will analyze notes by their cleaned text content (not just filenames) and report:
- β Notes that are identical
- β Notes only found in the old backup
- β Notes only found in the new backup
To generate a single clean set of notes, run:
pythrun copy-uniques.pyThis creates a uniqued-notes/ folder containing:
- All matched notes (only one copy)
- All notes unique to the old backup
- All notes unique to the new backup
If any filenames collide (e.g. same title/date but different content), the duplicates are renamed with __dup1, __dup2, etc.