# CSV to Typst

Paste CSV or TSV rows and get an escaped Typst table with a header row and horizontal rules.

CSV to Typst turns copied spreadsheet rows into a Typst table. Paste the rows, convert them, and paste the table into your `.typ` file.

## Use it when

- you copied a range from a spreadsheet or a results file;
- the data is already plain text, such as a small CSV export;
- you want escaped Typst source without writing the `table` call yourself.

For an `.xlsx` or `.xls` workbook, use [Excel to Typst](/docs/tools/excel-to-typst/). For a LaTeX document, use [Excel to LaTeX](/docs/tools/excel-to-latex/).

## Convert rows

1. Open **CSV to Typst**, or run `/csv-to-typst`.
2. Paste comma-separated or tab-separated rows, or choose **Load example**.
3. Choose **Convert**.
4. Check the row and column count in the note under the result.
5. Copy the table or save `table.typ`.

For example:

```text
Method,Accuracy,Runtime (s)
Baseline,0.82,14.2
Oleafly,0.95,9.8
```

becomes a `#table` with three columns. The first row is the header, set in bold. Columns of numbers are right-aligned and text columns left-aligned. Horizontal rules sit above the header, below it, and under the last row, with no vertical lines.

## Table behavior

- Oleafly detects tabs or commas from the first line.
- Quoted cells can hold commas, quotes, and line breaks. A line break inside a cell becomes a space.
- Characters Typst would read as markup, such as `#`, `*`, `_`, and `$`, are escaped.
- The conversion runs on your device.

:::caution[Size limits]
A table can have up to 10,000 rows and 100 columns, with no more than 2 MB of cell text.
:::

Inside a Typst document you can skip the copy and paste. Right-click in the editor and choose **Table from CSV/XLSX…**. That dialog reads CSV, TSV, XLSX, or JSON files, adds an optional caption and label, and can keep the table linked to its data file so the table updates on the next compile. See [Write in Typst](/docs/writing/typst/).
