How to import text, CSV or TSV into Anki (without mangled fields)
Short answer: Save your cards as a UTF-8 text file with one note per line and the same separator between fields on every line — a tab is safest. In Anki, choose File → Import, pick the file, and in the import screen check Field separator, Allow HTML, the note type, the deck and the field mapping in the preview before you import. If everything lands in the Front field, the separator is wrong; a #separator:Tab line at the top of the file fixes it for good.
1. Prepare the file
Anki imports plain text files — .txt, .csv or .tsv — with fields separated by commas, semicolons or tabs. A spreadsheet or Word file has to be saved as plain text first. The rules that prevent most problems:
- One note per line. The first field goes to the note's first field (Front, for the Basic type), the second to the second, and so on.
- The same separator everywhere. Anki decides how many fields there are from the first line that is not a comment. Missing fields on later lines are left blank; extra ones are not imported.
- UTF-8 encoding. The Anki manual says it expects UTF-8. In Excel, use File → Save As → CSV UTF-8 (Comma delimited); Google Sheets downloads are UTF-8 already. A file in another encoding is the usual reason accents and non-Latin scripts turn into garbage.
- Quote fields that contain the separator or a line break. In a CSV,
"Paris, France"stays one field; a literal quote inside is doubled:"". Spreadsheet programs do this for you when they save CSV. - Or use HTML instead of real line breaks. With HTML allowed, write
<br>for a new line. The manual recommends this for multi-line cloze notes, where quoted multi-line fields do not work correctly.
2. Add header lines (optional, recommended)
Since Anki 2.1.54, a text file can carry its own import settings in lines at the very top, each in the form #key:value. Anki then fills in the import screen for you, and the file imports the same way every time. A tab-separated example:
#separator:Tab
#html:true
#notetype:Basic
#deck:Spanish::Verbs
#tags:imported
hablar to speak
comer to eat
The headers the manual lists:
| Header | What it sets |
|---|---|
#separator | Comma, Semicolon, Tab, Space, Pipe, Colon, or the literal character |
#html | true or false — whether field contents are treated as HTML |
#columns | Names for the columns, separated by the separator — used for field mapping |
#notetype | The note type, by name or ID |
#deck | The target deck, by name or ID, if it already exists; :: makes a subdeck |
#tags | Space-separated tags added to every note |
#notetype column, #deck column, #tags column, #guid column | Which column (1, 2, 3…) holds that value per line — for files that mix note types or decks |
Two cautions. #notetype must match a note type in your collection exactly — if your Anki is in another language, the built-in “Basic” type has a translated name, so use that name. And older Anki versions do not apply these headers; lines starting with # are treated as comments there, so you set the same options by hand in the import screen.
3. Import into Anki
- In Anki on your computer, choose File → Import (or click Import File at the bottom of the deck list) and select your file.
- In the import screen, check Field separator. Anki guesses it; if the preview shows whole lines in one column, change it.
- Tick Allow HTML in fields if your file uses
<br>, bold text or media tags. Untick it if your cards contain angle brackets that should show literally, such asa < b. With HTML on, write<,>and&for literal<,>and&. - Choose the note type and the deck.
- Check the field mapping: which column goes to Front, which to Back, and whether a column should become tags.
- Decide what happens to existing notes. Anki matches duplicates by the first field. By default, a matching note of the same type is updated with the file's contents, keeping its scheduling and deck; you can instead keep the existing note or import a duplicate, and limit the match to the target deck.
- Click Import and read the summary — it tells you how many notes were added, updated or skipped.
When fields come out wrong
| What you see | Why | Fix |
|---|---|---|
| Everything in the Front field, Back empty | Wrong separator: Anki split on commas while the file uses tabs, or the reverse | Set Field separator to what the file really uses; add #separator:Tab to the file |
| Answers cut off at a comma, extra text in the wrong field | Comma-separated file with commas inside unquoted fields | Quote those fields, or switch the file to tabs |
| One card split over two notes | A real line break inside a field without quotes | Quote the field, or replace line breaks with <br> and allow HTML |
<br> or <b> shows up as text on the card | HTML not allowed for this import | Tick Allow HTML in fields, or add #html:true |
| Accented letters or other scripts garbled | File not saved as UTF-8 | Save again as UTF-8 (in Excel: CSV UTF-8) |
| Fewer new notes than lines | Lines matched existing notes by their first field and were updated or skipped | Read the import summary; change the existing-notes option if you want duplicates |
| Wrong note type chosen | #notetype name does not exist in your collection | Use the exact name shown in Tools → Manage Note Types |
Importing into Quizlet
Quizlet does not take a file; you paste text. Quizlet's help centre says importing works on the website.
- On quizlet.com, create a new flashcard set and click Import.
- Paste your text — one card per line, term and definition separated by the same character.
- Under the separator options, set between term and definition (Tab or Comma; a custom character is also possible) and between cards (New line or Semicolon, or custom).
- Check the preview: each card should show the term on the left and the definition on the right. Then import and save the set.
The same rule as Anki applies: if your definitions contain commas, separate with tabs. Quizlet has no quoting, so line breaks inside a card will start a new card — put each card on one line.
Skipping the file step
If your cards start as text you are reading in Chrome, Cardwright removes most of the steps above. You highlight text on a page, open the extension, and the selection is already in a single card editor: type an answer for a question-and-answer card, or click words to turn them into blanks for a fill-in-the-blank card. Then:
- Export · Anki downloads the deck as a tab-separated file that already starts with
#separator:Tab,#html:true, the note type and#deck:lines — so the file names the note type and the deck; if that deck doesn’t exist in Anki yet, pick or create it on the import screen. A deck that mixes question-and-answer and fill-in-the-blank cards goes into one file with a note-type column. - Export · Quizlet builds tab-and-new-line text with line breaks removed from each card, downloads it and copies it to your clipboard, ready for Quizlet's Import box. Fill-in-the-blank cards become term–definition pairs: the sentence with the gap as the term, the missing words as the definition.
- Send to Anki skips files entirely: with the Anki app open and the free AnkiConnect add-on installed, it adds the deck in one click, using its own “Cardwright Basic” and “Cardwright Cloze” note types, tagged
cardwright, with duplicates in the deck skipped. Because it brings its own note types, a translated name for “Basic” in your Anki does not get in the way. If it cannot connect, see AnkiConnect not working.
The exported file names a note type called “Basic” or “Cloze”, so the first caution in section 2 applies to it too: in an Anki whose built-in types have translated names, pick the note type by hand in the import screen, or use Send to Anki.
Every feature is free up to 25 cards and 3 decks, and cards you have already sent to Anki stop counting toward that limit. Cardwright Pro is a one-time $4.99 and removes the limit. Cards stay on your device; the only connections are to the Anki app on your own computer when you send, and to our licence server if you activate Pro.
Questions
Why does Anki put all my text in the Front field?
Anki used the wrong field separator, so it saw each line as a single field. In the import screen, set Field separator to the character your file really uses, such as Tab, and check the preview. Adding the line #separator:Tab at the top of the file makes the choice permanent.
Should I use CSV or TSV for Anki?
Both work. TSV, with a tab between fields, is the safer choice for flashcards because commas and semicolons are common inside answers, while tabs almost never are.
Which Anki versions understand the # header lines?
The Anki manual lists file headers such as #separator, #html, #columns, #notetype and #deck as supported from Anki 2.1.54. Older versions ignore lines that start with #, so you set the options by hand in the import dialog instead.
How do I import flashcards into Quizlet?
On the Quizlet website, create a new flashcard set and choose Import. Paste your text, set the separator between term and definition, for example Tab, and the separator between cards, usually a new line, then check the preview and import.