# Convert CSV to SQL

> Convert CSV to SQL INSERT statements online. Free CSV to SQL converter with a worked example and a live editor — seed a database from a spreadsheet.

Loading spreadsheet data into a database usually means writing INSERT statements by hand. This converter reads your CSV header as column names and turns each row into a parameter-quoted INSERT statement ready to run.

## Example: CSV → SQL

Input:
```
id,name,role
1,Ada,engineer
2,Linus,maintainer
```

Output:
```
INSERT INTO my_table (id, name, role) VALUES ('1', 'Ada', 'engineer');
INSERT INTO my_table (id, name, role) VALUES ('2', 'Linus', 'maintainer');
```

## How to convert CSV to SQL

1. Paste CSV with a header row naming the columns.
2. Each row becomes one INSERT INTO statement.
3. String values are single-quoted and embedded quotes are escaped for you.

## FAQ

### What table name is used?

The example uses my_table as a placeholder — rename it to your target table before running the statements.

### Are values typed or quoted?

Every value is wrapped in single quotes to be safe across columns. Remove the quotes around numeric or boolean columns if your schema requires it.

## Related converters

- [CSV → JSON](https://www.devkult.com/convert/csv-to-json.md)
- [JSON → CSV](https://www.devkult.com/convert/json-to-csv.md)
- [JSON → YAML](https://www.devkult.com/convert/json-to-yaml.md)

Open the interactive converter: https://www.devkult.com/convert/csv-to-sql