๐ Format Conversion ยท 7 min read
CSV to RIS: Import a Spreadsheet of References Into Zotero
A CSV does not convert to RIS by changing the extension, because the two formats disagree about what a row is. RIS marks every field with a two-letter tag on its own line and closes each record with ER. A CSV row has no tags at all. So the job is not conversion in the usual sense; it is writing each row out as a block of tagged lines.
Once you know that, the rest is bookkeeping. There are five tags a record cannot survive without, a fixed spacing rule that trips up hand-written files, and a handful of column types, authors and page ranges in particular, that need to be split rather than copied.
What an RIS Record Actually Looks Like
Here is a complete journal article record, five tags plus the terminator:
TY - JOUR
AU - Okafor, Adaeze M.
AU - Lindqvist, Per
TI - Sediment transport in tidal inlets
JO - Estuarine Research
PY - 2024
SP - 112
EP - 128
DO - 10.1038/s41586-020-2649-2
ER - Two letters, two spaces, a hyphen, one space, then the value. That spacing is not cosmetic. Parsers look for the tag pattern to decide where a field begins, and a line written with a single space before the hyphen is read as a continuation of the previous field or dropped outright. Nothing errors. The record simply arrives with fields missing.
TY declares the record type and comes first. ER closes the record and is mandatory. A file of forty references with thirty-nine ER lines imports as thirty-nine items, and the fortieth vanishes quietly.
The Tag Map From CSV Columns
Most reference spreadsheets carry the same dozen columns. This is the mapping that works across Zotero, Mendeley and EndNote:
| CSV column | RIS tag | Notes |
|---|---|---|
title | TI | Strip trailing periods; the style adds them. |
authors | AU | One line per author, family name first. |
year | PY | Four digits. 2024/05/12 is also accepted. |
journal | JO | T2 also works and is common for books. |
volume / issue | VL / IS | Keep them apart; merging them breaks the style. |
pages | SP + EP | Split 112-128 into start and end. |
doi | DO | Bare identifier, no https://doi.org/. |
url | UR | Publisher page or repository record. |
abstract | AB | Line breaks inside the value will break the record. |
The TY value deserves a moment. JOUR is a journal article, BOOK a book, CHAP a book chapter, CONF a conference paper, THES a thesis, RPRT a report, ELEC a web page. Write JOUR for everything and a book chapter will be formatted as a journal article in every citation style, because the importer trusts the tag over the fields.
A Script That Writes the Records
Standard library only. It reads columns by name, so reordering the spreadsheet does not silently swap titles for journals:
import csv
def authors(value):
return [a.strip() for a in value.split(";") if a.strip()]
def pages(value):
value = value.strip()
if "-" in value:
start, end = value.split("-", 1)
return ["SP - " + start.strip(), "EP - " + end.strip()]
return ["SP - " + value] if value else []
with open("references.csv", newline="", encoding="utf-8-sig") as f, \
open("references.ris", "w", encoding="utf-8") as out:
for row in csv.DictReader(f):
lines = ["TY - " + (row.get("type") or "JOUR").strip().upper()]
lines += ["AU - " + a for a in authors(row.get("authors", ""))]
for col, tag in (("title", "TI"), ("journal", "JO"), ("year", "PY"),
("volume", "VL"), ("issue", "IS"),
("doi", "DO"), ("url", "UR")):
v = (row.get(col) or "").strip()
if v:
lines.append(tag + " - " + v)
lines += pages(row.get("pages", ""))
lines.append("ER - ")
out.write("\n".join(lines) + "\n\n")Two details in that script are load-bearing. Reading with utf-8-sig drops the byte order mark that Excel writes, which otherwise attaches itself to the first header and makes title unfindable. Writing with a blank line between records keeps the file readable and is what most importers expect.
Abstracts are left out on purpose. A multi-line abstract breaks the one-line-per-field rule unless newlines are stripped, and a missing abstract does not affect a single citation style. If you need them, replace line breaks with spaces before writing.
The Four Mistakes That Produce an Empty Import
- No ER line. The record terminator is what makes a record a record. Count the
TYandERlines with a text editor orgrep -c "^ER"; unequal counts mean the file is broken before it reaches the importer. - One space instead of two. Hand-edited files, and exports from a few web tools, collapse the gap. The fix is a find and replace on the pattern rather than a rewrite.
- All authors on one AU line.
AU - Smith, Jane; Okafor, Adaezeimports as one author with a very long name. Every author needs its own line. - Leading zeros lost before export. An ISBN or a report number stored as a number in Excel loses its leading zero, and the imported reference carries a wrong identifier with no warning. Keeping the column as text is covered in keeping leading zeros in CSV.
Duplicates are the fifth problem, and the quieter one. Bibliographies assembled from three databases usually contain the same paper twice, once with a DOI and once without. Removing duplicates after the import is easier than before it, because the manager can compare resolved metadata rather than strings.
Check the File Before You Import It
Open the .ris in a plain text editor, not a spreadsheet. A spreadsheet will parse the two-space syntax as columns and show you something that looks plausible while telling you nothing. Then run three checks: every record starts with TY, every record ends with ER, and the first record contains the title you expect as a single line.
Import a file of five references before exporting four hundred. Zotero and Mendeley both report how many items were imported, and a mismatch of one is much easier to trace at five than at four hundred. If the import lands as a single untitled item, the tags are being read as body text, which points at spacing or at a file saved with the wrong extension.
When RIS Is the Wrong Target
Three destinations want something else. A LaTeX project wants BibTeX or BibLaTeX, because RIS loses citation keys and LaTeX-only fields. A web tool that accepts CSL-JSON wants the JSON variant, which is also the format Zotero uses internally and therefore the one that round-trips without loss. A Word reference list built by hand wants nothing at all: pasting formatted references into a document looks fine until the numbering changes.
For most people moving a spreadsheet into a reference manager, RIS is the right call. It is text, it is readable, and every manager on the market accepts it.
If the spreadsheet is a mess before it becomes RIS, the CSV analyzer reports column types and empty-field counts, which is how you find the author column that is half empty. Cleaning steps that apply to any reference list are in the dirty data guide, and the CSV format overview covers quoting when a title contains a comma.
Frequently Asked Questions
Can I convert a CSV to RIS in Excel?
Not directly. Build the tagged lines in helper columns, save as plain text, and make sure each field is on its own line with a TY at the start and ER at the end of every record. A script or a converter that understands RIS is usually faster.
Why did Zotero import zero items from my RIS file?
Usually a missing ER, a single space before the hyphen in the tags, or a file extension that is not mapped to RIS. Count TY lines against ER lines first.
What does the two-space syntax mean?
Each line is two letters, two spaces, a hyphen, one space, then the value. Parsers split on that pattern instead of on commas, and a malformed line is skipped rather than reported.
How do I handle multiple authors?
One AU line per author, family name first, in the source order. The first author decides how the reference sorts.
DOI in DO or UR?
DO for the DOI without the resolver prefix, UR for any other link. A DOI in UR is treated as an ordinary URL and will not be checked during a bibliography update.
RIS or BibTeX?
RIS for interchange between managers and for anything that goes into Word, BibTeX when the destination is LaTeX. RIS carries more record types and converts to BibTeX later; the reverse loses fields.
Find the Empty Columns First
Most failed imports start with a half-empty author column. The analyzer reports fill rates and inferred types for every column in seconds.
Related reading
Format Conversion โ other guides that pair well with this one.
- CSV to Chart Online Free
- Transpose a CSV File
- CSV Download Opens in the Browser? The Missing Header
- Pandas read_csv and Too Many Columns: Missing or Failing
Browse all guides in the NoCodeCSV blog.