I recently needed to manually modify the media associated with some of my Anki flash cards on macOS, but I hit a snag when I realized I didn’t know where the cards were located! Turns out they are here:

/Users/<your macOS username>/Library/Application Support/Anki2/<your anki username>/collection.media

You can use ‘cd’ from the command line to access this directory from the Terminal, or you can navigate there in Finder using the “Go” menu. Haven’t used it before? Here’s a quick demo (it’s an 8 MB .gif, so please be patient):

Using the Finder ‘Go to folder’ feature

Easy right?

Note: If you didn’t set an Anki user name, it’s probably “User 1”.

You can manually edit or replace the files in this directory, so long as you are careful not to change the filenames (cards reference files by name).

You can see how this works if you export a deck to a .txt file. It will contain references to files in []. Here’s an example from my Italian practice flash cards (Italian on one side, English + Italian pronunciation on the other):

#separator:tab
#html:true
o 	 or [sound:8032708d88f3d2b03ff7986ad3ac52da.mp3]
anni 	 years [sound:778c7ae9bd988a0f55292546273c1f99.mp3]
tali 	 such [sound:0f933ff6cd9c953aba0a2a7c1eb83a13.mp3]

The files referenced in the [sound:] blocks are indeed stored in Anki2/<anki username>/collection.media.

Being able to directly insert files into collection.media has proven very useful for me when I am auto generating cards in bulk. I sometimes use Python scripts or large language models to generate new flashcards, and will auto-generate words using services like OpenAI’s tts-1 or Amazon’s Polly.