Moodle Import Questions from Excel: Convert CSV to GIFT
Moodle has no Excel or CSV question importer. Here is the conversion that works: the spreadsheet formula that writes GIFT, and the escaping rule that breaks it.
By the VidQuiz team
August 2026 · 8 min read
Try it while you read
What you are looking at
Three quizzes VidQuiz generated from three real YouTube videos. They are saved output, not generated in your browser. Pick one to answer it, and open the source video to check the questions against what is actually said in it.
Your own video gets a fresh quiz once you sign up.
We have not read that link.
This page only serves quizzes that were already generated, and it does not send your link anywhere. Reading a video takes about half a minute of real work on our side, so it runs in your account, not in an anonymous demo.
Moodle has no Excel importer and no CSV importer. Core Moodle ships seven question format plugins and a spreadsheet is not one of them. To get an Excel question list into a Moodle question bank you convert it to GIFT or Aiken first, both of which are plain text, then import that file through the question bank. One spreadsheet formula does the conversion.
This is one of the most searched Moodle questions and one of the most badly answered, because the honest answer starts with a no. People arrive holding a spreadsheet that a colleague built, or a question list a subject matter expert wrote in Excel because Excel is what they had open, and they expect the import screen to take it. It will not. What follows is the conversion that actually works, the formula that does it, and the one syntax rule that silently breaks hand built files.
Why Moodle will not read your spreadsheet
Moodle's question importer is a plugin system, and the set of plugins that ship with core Moodle is small and fixed. On both the 4.5 and 5.0 stable branches, the question/format directory in the source tree contains exactly seven format plugins: aiken, blackboard_six, gift, missingword, multianswer, xhtml and xml. That list has not changed between the two releases.
None of them reads a spreadsheet. There is no Excel plugin, no CSV plugin and no Word plugin in core. Moodle does use CSV elsewhere in the product, for bulk user upload and for grade import, which is exactly why the assumption is so common and so reasonable. Questions simply work differently.
Anything outside those seven formats needs a plugin installed at the site level, which means an administrator and, at most universities, a ticket. Moodle2Word is the usual one people are pointed at for Word documents. It is real and it works, but an instructor cannot switch it on alone, so it is rarely the fastest path to a quiz that is due this week.
Aiken or GIFT: which one should you convert to?
Both are plain text, both import into core Moodle without any plugin, and the choice between them decides what survives the trip.
| Format | Question types | Carries | Best when |
|---|---|---|---|
| Aiken (.txt) | Multiple choice only, exactly one correct answer | The correct answer. Nothing else | Simple multiple choice, and you want a file anyone can edit in Notepad |
| GIFT (.txt) | Multiple choice, true or false, short answer, matching, missing word, numerical, essay, description | Answer key, per question feedback, point weighting, question names | You have explanations or weighting to keep, or more than one question type |
| Moodle XML (.xml) | Every type Moodle supports | Everything, including images | Moving a bank between Moodle sites. Painful to generate from a spreadsheet |
For a spreadsheet conversion the practical answer is almost always GIFT. Aiken looks tempting because it is simpler, but it drops feedback and point values with no warning, and most people only notice weeks later when they wonder why students see no explanation after submitting. If your spreadsheet has an explanation column at all, use GIFT.
How to convert an Excel question list to GIFT
GIFT is whitespace tolerant, so an entire multiple choice question fits on one line. That is what makes the conversion a formula rather than a project. A single line GIFT question looks like this:
::Q1:: Which port does HTTPS use? {=443 #Reserved for TLS. ~21 ~80}
The ::Q1:: part is the question name that appears in the bank. The equals sign marks the correct option, each tilde marks a wrong one, and the hash introduces the feedback shown after the answer is submitted.
Set the spreadsheet up so that column A holds the question, column B holds the correct answer, columns C, D and E hold the three distractors, and column F holds the explanation. Reordering so the correct answer is always in column B is worth the two minutes: it removes every lookup from the formula. Then in column G, on row 2:
="::Q"&ROW()-1&":: "&A2&" {="&B2&"#"&F2&" ~"&C2&" ~"&D2&" ~"&E2&"}"
Fill that down the column. Every row becomes one complete GIFT question. Select the whole of column G, copy it, paste it into a plain text editor, and save as a .txt file with UTF-8 encoding. That file is what you upload.
Two details that matter. Save as .txt, not .docx and not .rtf, because a word processor will insert typographic quotation marks and other characters that break the parse. And keep the spreadsheet: it is now your master copy, and regenerating the file after an edit takes seconds.
How to convert a spreadsheet to Aiken format
If your questions genuinely have no feedback and no weighting, Aiken is four lines per question and needs no formula at all. Build six columns: the question text, then A) joined to the first option, B) joined to the second, and so on, then a final column reading ANSWER: joined to the correct letter. Select the block, paste it into a text editor, and you have a valid Aiken file.
Aiken has three hard rules worth knowing before you commit. The file must be UTF-8, and Moodle validates that on upload rather than failing partway through. Each question needs at least two options or Moodle rejects that question and carries on with the rest. And each option line must begin with a capital letter followed by either a bracket or a period and then a space, so a) in lower case will not be recognised as an option.
The escaping rule that breaks hand built GIFT files
This is where most homemade conversions fail, and the failure is quiet. GIFT treats six characters as syntax: the colon, the hash, the equals sign, the opening brace, the closing brace and the tilde. If any of them appears inside your question text or your options, the parser reads it as structure rather than content and the question comes out mangled or is skipped. The backslash is the escape character itself, so a literal backslash has to be doubled.
Chemistry, maths and anything involving code hit this constantly. A question about pH tolerances, an option containing x = 5, a stem quoting a hashtag: all of them break. The fix is a backslash immediately before the character. To do it in the spreadsheet, wrap the cell reference in nested substitutions:
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"\","\\"),"~","\~"),"=","\=")
Nest further for the hash, the braces and the colon if your content uses them. Escape the backslash first, always, or the later substitutions will escape the backslashes you just added.
Why did my Moodle question import fail?
When an import fails or imports fewer questions than the file contains, it is nearly always one of five things. An unescaped control character in a GIFT file, which is the most common by a wide margin. A file that is not UTF-8, usually because it was saved from a word processor. A question with fewer than two options. A file saved with the wrong extension, so the format you picked on the import screen does not match what is in the file. Or the site upload size limit, which an administrator sets and which is commonly between 2MB and 50MB, though plain text question files are small enough that this only bites when images are involved.
Moodle shows you the questions it parsed before it commits them. Read that preview rather than clicking through it. A file that should have produced forty questions and produced thirty seven tells you exactly where to look.
Where the import screen actually is
Not in the quiz. Every question in Moodle lives in a question bank and a quiz is a selection from one, so the importer sits on the bank screen: open the course, go to the question bank, choose Import, pick the format, choose the destination category, upload. In Moodle 4.5 and 5.0 the importer is a question bank plugin named qbank_importquestions, which is why it appears there and nowhere in quiz settings.
Make the category before you import. Moodle will happily drop four hundred questions into whatever category happened to be selected, and untangling that in a bank shared across a department is genuinely unpleasant. A category named after the source material also makes the random question draw useful later, because a quiz that samples one tight category samples that topic evenly.
The full walkthrough of the GIFT syntax, including the question types beyond multiple choice, is in our guide to importing questions into Moodle step by step, and the wider format picture across platforms is covered in QTI vs GIFT vs CSV.
When converting the spreadsheet is the wrong move
Before you build any of this, it is worth asking where the spreadsheet came from. A surprising share of question lists in Excel are a transcription of something else: a recorded lecture, a compliance training video, a webinar, a slide deck someone narrated. Somebody watched the source, wrote questions in a spreadsheet because a spreadsheet was open, and now that copy has to be converted into a format Moodle reads.
If that describes yours, the conversion is the second problem and the smaller one. Generating the questions from the source directly skips the spreadsheet entirely. VidQuiz takes the recording, writes the stems, the options, the correct answer and an explanation on every item, and exports a GIFT file that imports into a Moodle question bank as it stands, with a timestamp on each question pointing back at the moment in the video it came from. That is the whole of what this page describes, minus the formula. The detail sits on our page about how to import questions into Moodle, and the generation side is on the Moodle quiz generator.
Where the source material is a document rather than a recording, a study guide, a policy PDF or a set of slides, the same logic applies but a different tool fits: you can turn the document itself into questions and skip the transcription step just as completely. And if the file has to land somewhere other than Moodle, our quiz converter covers which format Canvas, Blackboard, Brightspace and D2L each accept, since none of them agree.
The short version
Moodle reads seven question formats and Excel is not among them. Convert to GIFT with a one line spreadsheet formula, escape the six control characters, save as UTF-8 plain text, and import through the question bank rather than the quiz. If the questions came from a recording in the first place, generate them from it and let the GIFT file come out finished.
Turn any video into a quiz
Paste a YouTube link (a lecture, training or webinar) and VidQuiz writes the questions for you, with answers and explanations. See how it works or explore use cases.