I am excited to see more solutions that work with Apple Notes database directly. This is my go-to application to capture unstructured memos while researching various topics. Last year I got carried away and built a simple site generator for Notes [0]. As a fun exercise I implemented ORM models to query Sqlite database in Ruby:

  User::Account.server(database: "tmp/test.sqlite").first.
    find { |el| el.is_a?(User::ObjectTypes::EmbeddedPublicJpeg) &&
      el.height > 700 &&
      el.summary[/animal/i] }.
 => "Accounts/<uuid>/Media/F669B83A-0C47-408E-9645-015737F3B11F/Pasted Graphic.jpg"
Apple Notes' database structure is a fascinating product story. Notes started as a simple note-taking application that stored its content as raw HTML in a few simple tables. However, as the product grew and needed more features like collaboration, they had to make changes and add new columns and tables. They also implemented two flavors of CRDT-like algorithms that evolved over time: one for plaintext chunks and the other one for embedded objects like tables. On top of that, every change that Apple makes must be backward compatible to support legacy devices and systems; but backward-compatibility was not always possible and users had to go through “Migrate your Notes” steps, but it is again a product story.

I wish that one day, someone from the development team would write an article about it.


I wrote a similar tool in Python a few weeks ago, which uses AppleScript to liberate the data and saves it to a SQLite database:

I didn't actually know AppleScript before writing this tool... but it turned out ChatGPT knew it well enough to unblock me and provide me with exactly the code I needed to build the rest of the project!

Apple Notes Liberator creates a copy of the SQLite database and then runs queries against that directly to extract the data.

I chose not to do that (despite being all-in on SQLite for everything) because I worry about future changes to the software baking my script - I figured the AppleScript interface was less likely to have breaking changes in the future.

A feature that a lot of Apple apps have that doesn't seem talked about much is they can use standard protocols and not require iCloud. can use IMAP, with CalDAV, and with CardDAV [1].

It doesn't offer a lot of the features iCloud has like advanced formatting or collaboration, but is a useful for simple standards based syncing and portability.

I've done this with my iPhone/Macs and Fastmail for the last few years and it works great [2].



Super interesting, particularly the link through to the blog with all the research into how Notes works.

A particularly interesting thing that I don't see mentioned anywhere is that Apple Notes uses CRDTs (conflict free replicated data types) to enable both shared notes and multiple concurrent edits. With the CRDTs resolving the conflicts.

It looks like the info on the page may be a good place to start looking to how that works:

I have published an app [Exporter]( that does something similar - exports Apple Notes to HTML and markdown with the attachments. Give it a try, let me know if it solves your issue.

Also, why did you select JSON as the output format?

Cool! Thanks for sharing. Also worth noting that there's a Mac app in the app store to export to markdown or html:

(I haven't had a need yet, so I haven't tried it)

If anyone ever wanted to do something similar for iMessage data, I built a similar tool for that:
I consistently struggle with Notes and iMessage sync issues, and I suspect it’s due to being a customer for so many years and making my way through many devices over those years.

The UX of the Apple ecosystem is so nice but when it goes sideways you’re kind of out of luck, even if you have applecare.

I wish they had some sort of premium “fix my esoteric appleID account issues” service you could pay them for once a decade or so.

This is great! How do you account for updates to a note?

I’ve been building an archiver tool as well to convert notes into markdown and post to git using Apple Shortcuts.

The interop between almost all iOS data formats (notes, safari, calendar, etc.) the content graph[0] provides is really impressive.


Here's a Python script that takes the JSON output from (needs master), and rebuilds Notes in Markdown format (or HTML), with links, attachments, lists, etc.:

And a short, standalone JXA script, that outputs HTML, but loses some data, such as links:

Love this. I am an Apple Notes absolutist (see: I have tried Evernote, Workflowy, Dynalist, Notion over the years for marrying personal / professional worlds but always (always!!) come back to Notes.

I have dreamed of the ability to have a Notes web app with custom CSS for years and a few other features.

Good luck with this project I'll be watching closely

I don't understand what value this tool adds over the library it uses under the hood (which includes a command line tool for exporting your notes; I've been using it for years). What is it for?
Note that can also sync with IMAP.

IMAP syncing supports basic formatting (bold, italic, underline) but not all features supported by iCloud syncing (attachments, checklists, photos).

Oh neat. I’ve been using Notes extensively since the beginning of this year. Daily journaling. Personal TODO lists, grocery list (shared w my wife), and gym/workout tracking.

It works really well and has way more features than people realize. If you’re looking for like a “Notion-lite”, the answer might already be on your phone/MacBook.

So now we know how to export data from the, &

What’s next?

As a windows user, while we don't have an OS built-in equivalent, the standard for such tools (in the form of Sublime and the like) is just to operate with temporary buffers that get written out as files on user request. Sublime will write internal data to some persistent storage somewhere and be able to survive sudden crashes and restarts but when you'd like to save the data out to a fixed filepath it's pretty trivial to do so. I do find it quite weird that Apple has managed to cultivate a system where storage in separate files isn't taken as the default.
I am excited to see more ways to export data out of Apple Notes. Long term it would be amazing to see a solution that allows more interoperability with other apps.

Depending on what you are looking to achieve there are a few ways to export Apple Notes to Markdown files, but it's only a one-way out solution.

From the Obsidian forum:

I have been adopting Apple Notes more after trying to use a lot of other note methods/apps. Always fall back to simple text in Notes. And I seem to be hearing of more people doing the same.

I recently set up a shortcut that works on both my Mac and iPhone to create a new note each day with the date as the title. And then each time I trigger the shortcut that day, it enters the time, location and weather. Easy way to keep a running "diary."

This is cool. I wanted to provide notes export for people using a note taking service I built and landed on a ios shortcut.

I think you can accomplish something close or the same? using shortcuts.

One obvious benefit is the interface is going to be more approachable than the jar to most people.

Shortcuts are also cool because you can build one and package it for others and even define user specific parameters that get filled on install.

Very nice reverse engineering work! I wrote a python library and CLI that does something similar but interacts with Notes via Scripting Bridge:
I built something similar a while back.

But instead of pulling the data out of Notes, I took it from SMTP mail.

I don't know if it still works this way, but when I did it, if you used a non-iCloud email address to sync Notes, it saved the data as pain text in email messages that could be easily parsed.

instead of extracting notes data as JSON my simple tool allows you to liberate your notes by publishing them to the web.

I use the same amazing library linked in the blog post.

Why not just use the built-in Shortcuts to export to your preferred format?
Awesome initiative! I wish Apple Notes would support Markdown. This is my go to app for so much of my life, à Notion style editor would be an absolute game changer.
"Liberator" implies it was locked down. But notes content has always been easily accessible with AppleScript.
For a long while I just copied everything to an imap server and dumped the mailbox, but this looks like an even better solution.
Nice! It throws an error that it cannot find the notes folder though.

Where is it located usually? Or what's the file name?

Thanks for creating this. I must say that I don't find things written in Java on HN very often.
It would be really cool to set this up to automatically sync notes to Obsidian.
This but for the Mac Library now please (the format transfer are a mess)
I wish someone did this for Whatsapp without having to jailbreak my phone.
I wish there's tool to extract Apple Books' notes too