TXT to Google Form: Turn a .txt Question File Into a Quiz Without Re-typing
"txt to google form" and "how to import text file to google forms" come from the same situation: your question bank is a plain .txt file from Notepad, an LMS export or a colleague, and Google Forms will not read it. There is no Upload .txt button. The reliable route is to let a converter parse the text into structured rows and write the form under your account — no manual reformatting, no re-typing. This guide covers what actually needs cleaning (encoding and line endings), a runnable normaliser, and the mistakes that lose options or the answer key.
Why Google Forms cannot read a .txt file
Forms accepts a form you build in its editor, or a form duplicated from Drive. It does not ingest text, CSV, Word or PDF files as questions. So "can I upload a txt file to a Google Form" has a clear answer: not directly. Something must parse the file into item objects — either your own script or a converter that does the whole job.
Plain text is actually a good source: unlike a scanned PDF there is no OCR error, and unlike a two-column Word layout there is no reading-order ambiguity. The main risks are file-level (encoding, line endings) and pattern-level (how options and the answer are written).
The three file-level problems (and their fixes)
| Problem | Symptom | Fix |
|---|---|---|
| Wrong encoding (GBK / Windows-1252 saved as UTF-8) | Accented or CJK characters become ???? or mojibake | Detect and re-save as UTF-8; the normaliser below does it |
| UTF-8 BOM | First line starts with an invisible \ufeff; the first question number fails | Read with utf-8-sig |
| CRLF / mixed line endings | Options merge into the stem, or blank lines appear mid-question | Normalise \r\n and \r to \n |
Runnable normaliser: .txt → clean UTF-8 text
import chardet # pip install chardet
import re
def read_txt(path):
raw = open(path, "rb").read()
enc = chardet.detect(raw)["encoding"] or "utf-8"
if enc.lower() in ("ascii", "us-ascii"):
enc = "utf-8"
text = raw.decode(enc, errors="replace")
text = text.lstrip("\ufeff") # strip BOM
text = text.replace("\r\n", "\n").replace("\r", "\n") # CRLF
text = re.sub(r"[ \t]+$", "", text, flags=re.M) # trailing ws
text = re.sub(r"\n{3,}", "\n\n", text) # collapse blanks
return text.strip() + "\n"
clean = read_txt("questions.txt")
open("questions_clean.txt", "w", encoding="utf-8", newline="\n") \
.write(clean)
print("ready to upload:", len(clean.splitlines()), "lines")That is the whole "manual cleanup" you should ever need — and it is optional if your file is already UTF-8 with normal line breaks. If your text uses a numbered stem with A–E options and an Answer: X line, the MCQ parser in Import Multiple Choice Questions into Google Forms turns it into fixed columns; if you would rather not run code, upload the .txt straight to the converter and it does the parse.
What the importer needs from your text
One question per block, in a repeatable pattern:
1. Which planet is closest to the Sun?
A) Mercury
B) Venus
C) Earth
D) Mars
Answer: A
Marks: 1
2. The Earth is flat. True or false?
A) True
B) False
Answer: B
Marks: 1The converter maps this into Number / Type / Stem / Option A–E / Answer / Marks / Image URL and writes a form you own. Consistent separators matter more than pretty formatting. If your file instead has one question per line with comma-separated fields, see CSV to Google Forms; for pasted text rather than a file, Text to Google Form covers the paste workflow.
TXT to Google Form in 5 steps
Troubleshooting
- Garbled characters. The file is GBK/Windows-1252; re-save as UTF-8 (the normaliser detects it).
- First question is skipped. A UTF-8 BOM is prefixed to line 1; strip it.
- Options merged into the stem. Mixed CRLF/LF line endings; normalise them.
- Questions split or joined. Blank lines are inconsistent; collapse 3+ newlines to 2 and start each question with a number.
- Answer key missing. The key is in a separate block at the end, or written as "Ans A" instead of "Answer: A"; normalise the prefix or join by number.
- All marks are 1. Put points on their own numeric line/column.
- Images missing. A .txt cannot embed images; keep one public URL per question and attach after import.
- Nothing uploads. Check the file really is
.txtand not a renamed.docx; a Word file saved with a .txt extension is still binary.
Check the file
Confirm it is real plain text, note the encoding and line endings.
Normalise (optional)
Run the script: detect encoding, strip BOM, unify line endings.
Keep a consistent pattern
Numbered stem, one option per line, Answer/Marks on their own lines.
Upload
Let the converter parse into fixed columns and write the form under your account.
Verify
Open the form; check the first, middle and last question, then enable quiz mode if needed.
Frequently asked questions
Can I upload a .txt file to a Google Form?
Not directly. Google Forms has no text-file or CSV import for questions; it only builds items in its editor or duplicates an existing Form. To turn a .txt into a quiz you need a script that parses the file, or a converter that parses it and writes the Google Form under your own account.
How do I import a text file into Google Forms without re-typing the questions?
Keep a consistent pattern (numbered stem, one option per line, 'Answer: A' and 'Marks: 1' on their own lines), make sure the file is UTF-8 with normal line endings, then upload it to a converter that maps the text into fixed columns and creates the form. No manual spreadsheet cleanup is required.
Why are characters garbled after importing a .txt?
The file was saved in GBK, Windows-1252 or another legacy encoding but read as UTF-8. Detect the encoding and re-save as UTF-8; strip a UTF-8 BOM if present. The runnable normaliser in this guide does both.
What is the difference between 'txt to Google Form' and 'text to Google Form'?
They describe the same conversion; 'txt' usually means a .txt file on disk (so encoding, BOM and CRLF matter), while 'text' often means pasted plain text. This guide covers the file case; see Text to Google Form for the paste workflow.
Does the answer key survive a .txt import?
Yes, if the source has an explicit answer per question and the destination is in quiz mode with the correct flag attached to the choice. A key listed only at the end of the file must be joined back by question number.
Question importers
ExamParser has a dedicated importer for each source format. Pick the one your questions currently live in — PDF, Word, Excel, Google Sheets or a quiz file — and the questions, options and answer key are carried into a Google Form you own.
Related guides
- Text to Google Form (pasted plain text)
- How to Import Questions into Google Forms (every method)
- CSV to Google Forms
- Bulk Upload Questions to Google Forms
- Import Multiple Choice Questions into Google Forms
- Convert File to Google Form (umbrella)
Upload the .txt and get a finished form
No manual cleanup, no re-typing, no AI inventing questions. Upload the text file you already have and get a Google Form you own, with the questions, options, answer key and marks carried over exactly as written.
Import my questions into Google Forms →