> ## Documentation Index
> Fetch the complete documentation index at: https://relevanceai.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# 'Convert a spreadsheet to JSON' Tool step

> Use a Tool step to convert CSVs and XLSXs into JSON

The 'Convert a spreadsheet to JSON' Tool step allows you to convert a CSV or XLSX file into JSON for your Tools to use.

## Add the 'Convert a spreadsheet to JSON' Tool step to your Tool

<div style={{ width:"100%",position:"relative","padding-top":"56.75%" }}>
  <iframe src="https://app.supademo.com/embed/cmbrf6vyscbn6sn1r1drty9ln" frameBorder="0" title="Add the Convert a Spreadsheet to JSON Tool step to your Tool" allow="clipboard-write; fullscreen" webkitAllowFullscreen="true" mozAllowFullscreen="true" allowFullscreen style={{ position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"3px solid #5E43CE",borderRadius:"10px" }} />
</div>

You can add the 'Convert a spreadsheet to JSON' Tool step to your Tool by:

1. Creating a new Tool, then searching for the 'Convert a spreadsheet to JSON' Tool step
2. Click 'Expand' to see the full Tool step
3. Add the CSV or XLSX file you want to convert to JSON
4. Click 'Run step' to run the Tool step
5. Your output will be formatted - click 'Formatted' to see the JSON output if needed

## Using the Tool output

The output is a dictionary with a key `rows`.

* `spreadsheet_to_json[rows]` is a list containing as many rows as included in the uploaded file.
* Each row is a dictionary representing one row of data (i.e. keys are column headers in the uploaded spreadsheet).

Below you can see samples where the default name assigned to the step `spreadsheet_to_json` is used.

```
spreadsheet_to_json.rows
spreadsheet_to_json.rows[0]
```

## Common errors

<Accordion title="Unsupported file type">
  The error message similar to the one below indicates that a non-spreadsheet file was uploaded to the Tool step. Only CSV and XLSX files are supported.
  `Unsupported file type: pdf`
</Accordion>
