I recently found myself needing to convert many “Basic” note types to “Cloze”. I greatly prefer the cloze type since it allows me to quickly make reverse cards. That is to say, I find a bidirectional connection between a term and its definition better for retention.

graph LR
  term1[Term A] --> def1[Definition A]
  term2[Term B] --> def2[Definition B]
  def2[Definition B] --> term2[Term B]

Note: I’m unsure if this preserves progress and card information, but I think it does. Your mileage may vary.

  1. Back up Anki first, so you can restore in case anything goes wrong.

  2. Select all the “Basic” card type notes (the note:Basic search filter is useful here)

    image.png

  3. Export these cards using Notes → Export Notes. Use these settings:

    image.png

  4. Run the script, either by downloading it from GitHub, or using the excellent uvx package manager:

    uv run --script "<https://gist.github.com/olliecheng/a7fe279f42054433fbd021c70ad21f96/raw/d097695f2f61782bff800ddd955078dbf849a21e/basic_to_cloze.py>" \\
    	<input_file> <output_file>
    

    https://gist.github.com/olliecheng/a7fe279f42054433fbd021c70ad21f96

  5. Import back to Anki from the main screen (File → Import) and select the output file. Use these settings:

    image.png

  6. Select all the updated cards, which are still Basic cards, right click, and choose Notes → Change Note Type. Change “Basic” to “Cloze”, while keeping all the other parameters unchanged.

    image.png

  7. Done!