PDF to Anki: how to make Anki flashcards from a PDF

    Let AI write the cards from your PDF, export them as a CSV, and import the file into Anki with the right separator, note type and field mapping. Every setting is below.

    • No credit card
    • Free plan after the trial
    • Cancel anytime

    renal-physiology.csv

    3 cards

    "Front","Back"

    "Loop of Henle","Concentrates urine by creating a salt gradient in the medulla"

    "ADH","Increases water reabsorption in the collecting duct"

    "Podocytes","Wrap glomerular capillaries and form filtration slits"

    Separator
    Comma
    Note type
    Basic
    Column 1
    Front
    Column 2
    Back

    Quick answer

    How do you make Anki cards from a PDF?

    Generate flashcards from the PDF with an AI tool, export them as a CSV file, and import that file into Anki. In QuerySpark: upload the PDF, generate a deck and use Export CSV. In Anki desktop: File, Import, pick the file, set the field separator to Comma, choose the Basic note type and your deck, map column 1 to Front and column 2 to Back, then click Import. QuerySpark has no direct Anki export, but the CSV imports cleanly. It is free to start with a 3-day Pro trial.

    • Export: CSV with Front and Back columns
    • Anki: File, Import, Comma, Basic
    • Import on Anki desktop, then sync to your phone
    • Free to start: 3-day Pro trial, no card

    Step by step

    How to make Anki flashcards from a PDF

    Four steps from a PDF to a deck in Anki. Writing the cards is the slow part by hand; the import itself takes under a minute.

    1. 01

      Generate cards from the PDF

      Upload the PDF to QuerySpark (scanned pages are read with OCR) and generate flashcards. One chapter per upload keeps each deck to a single topic.

    2. 02

      Export the deck as CSV

      Use Export CSV on the deck. You get a file with a header row (Front, Back) and one card per row, each side in double quotes.

    3. 03

      Remove the header row

      Open the file in a text editor or spreadsheet and delete the first line, Front,Back. Anki would otherwise import it as a card. This is also the moment to delete weak cards.

    4. 04

      Import into Anki

      In Anki desktop choose File, then Import, and select the CSV. Set the field separator to Comma, the note type to Basic and the deck you want, map column 1 to Front and column 2 to Back, then click Import.

    Anki import

    The Anki import screen, setting by setting

    Recent versions of Anki desktop show one import screen for text and CSV files. These are the choices that match a QuerySpark export.

    SettingChooseWhy
    Field separatorCommaThe export is comma separated, with quotes around each side, which Anki reads correctly
    Allow HTML in fieldsOffThe cards are plain text, so there is no markup to keep
    Note typeBasicOne card per note. Pick Basic (and reversed card) if you also want to be asked from the back
    DeckYour chapter deckCreate the deck in Anki first so it appears in the list
    Existing notesUpdate or PreserveMatters when you import a second version of the same deck
    Field mappingColumn 1 to Front, column 2 to BackLeave Tags empty unless you added a third column

    Keeping the header instead. Anki reads lines at the top of a file that start with # as instructions. If you would rather keep a header than delete it, replace the Front,Back line with two lines, #separator:comma and #columns:Front,Back, and Anki will pick the separator and match the columns to fields with the same names.

    After importing, open the Browse window, select the new deck and read a dozen cards. If the fronts and backs are swapped, delete the notes and import again with the field mapping reversed.

    Card design

    Tips: cloze vs basic, and tags

    Two choices that decide how useful the deck is a month from now.

    Cloze or basic?

    Basic cards suit a term and a definition. Cloze cards hide part of a sentence, written as {{c1::mitochondria}}, and suit lists, sequences and facts that only make sense in context. The export is term and definition, so import it as Basic. If you want cloze cards, rewrite those rows into one Text column with the cloze markers, then import that file with the Cloze note type.

    Tag as you import

    Add a tag in the import screen, such as the course code and chapter, so every imported note carries it. For finer tags, add a third column in the spreadsheet, map it to Tags, and separate several tags with spaces. Tags let you build a filtered deck of one chapter the week before an exam.

    Can ChatGPT make flashcards for Anki?

    Yes, with some care. Paste a section of the PDF into the chat and ask for one card per line, front and back separated by a semicolon, with no numbering and no blank lines. Save the reply as a plain .txt file and import it with Semicolon as the field separator. If a definition needs a semicolon, ask for a pipe character instead and choose that as the separator.

    The limits are worth knowing. Chat tools can skip material in a long document, so give it a chapter or a few pages at a time rather than a whole textbook. The cards are only as accurate as the model, so check each one against the PDF; a wrong card studied for a month is worse than no card. A scanned PDF has to be readable text first, which not every chat tool handles.

    An AI flashcard generator built for this skips the prompting: QuerySpark reads the whole file, including scanned pages, and writes the cards from it. See the AI flashcard generator and PDF to flashcards for what the cards look like.

    What makes a good Anki card from a PDF

    A PDF chapter is written to be read, not recalled, so the first draft of any deck, by hand or by AI, has cards that are too big. The test for each card is whether you can answer it in a few seconds without hedging. A card that asks for a whole process should become three cards, one per step.

    Keep the front specific. "Kidney" is not a question; "Where in the nephron is most glucose reabsorbed?" is. Keep the back short enough to say out loud. And keep cards about things that are in the PDF: when a deck drifts into general knowledge the chapter does not cover, it stops matching what you will be examined on.

    Trim before importing rather than after. Deleting twenty rows in a spreadsheet takes a minute; suspending twenty cards across a week of reviews takes much longer.

    The other option

    Or study with QuerySpark's own spaced repetition

    You do not have to move the deck at all. QuerySpark schedules flashcards with spaced repetition in the browser: rate each card as known, still learning or not known and it comes back accordingly. The same upload also gives you practice questions with an explanation for every answer, and a study guide for the chapter.

    Anki remains the better choice if you already review in it every day, want detailed control over the scheduler, rely on add-ons, or study from large shared decks. Plenty of people do both: generate in QuerySpark, review the practice questions there, and keep the long-term card deck in Anki.

    Compare QuerySpark and Anki
    A flashcard showing a definition with Didn't know, Still learning and Know it buttons

    Pitfalls when importing a PDF deck into Anki

    Each of these is a two minute fix before the import and a long one after it.

    • The header row becomes a card. Delete the Front,Back line before importing, or find the card afterwards in the Browse window and delete it.

    • Images and diagrams are not included. The CSV is text only. If a card depends on a figure, paste the image into the note in Anki's editor after importing.

    • Overloaded cards. Anki works best with one fact per card. If a back runs past two lines, split it into two rows before you import, or you will keep half remembering it.

    • Phone first. Importing a CSV is easiest on Anki desktop. Import there, then sync with AnkiWeb so the deck appears in the mobile app.

    • Duplicates on reimport. Importing the same file again with Duplicate selected doubles the deck. Use Update or Preserve, or import into a fresh deck.

    • Formulas lose formatting. Subscripts and superscripts can arrive as plain characters. Fix chemistry and maths cards in the file, or use Anki's MathJax support for those notes.

    PDF to Anki questions

    Generate flashcards from the PDF with an AI tool such as QuerySpark, export them as a CSV file, and import it in Anki desktop with File, then Import. Set the separator to Comma, choose the Basic note type and a deck, and map the two columns to Front and Back.

    Yes. Tools like QuerySpark write flashcards from the PDF itself and export a CSV that Anki imports, chatbots such as ChatGPT can write cards from text you paste in, and community add-ons can call AI models from inside Anki. Whichever you use, read the cards before studying, because AI can get details wrong.

    Yes. Paste a section of your material and ask for one card per line with the front and back separated by a semicolon, then save the reply as a .txt file and import it with Semicolon as the separator. Give it long PDFs a section at a time and check every card against the source.

    No. QuerySpark exports flashcards as CSV, not as an .apkg deck file. Anki imports the CSV in a few clicks, and you choose the deck and note type during the import.

    Use basic cards for terms and definitions, which is what the CSV export contains. Use cloze cards for sentences, lists and processes where the context matters, which means rewriting those rows with {{c1::...}} markers and importing them with the Cloze note type.

    It is simplest on Anki desktop. Import the file there, then sync with AnkiWeb and the deck appears on your phone.

    Anki desktop is free. QuerySpark starts with a 3-day Pro trial with no card, and the free plan after it includes 20 flashcards and 10 PDF pages a month, which is enough to try the workflow on one chapter.

    Yes. In Anki, export the notes as Notes in Plain Text and paste the result into QuerySpark's import, which reads tab-separated front and back fields. The cards then get QuerySpark's spaced repetition schedule.

    Still stuck? Email us.

    Write the Anki cards from your PDF

    Start with a 3-day Pro trial. No credit card, and you keep every deck you make.