Generate CREATE TABLE and INSERT statements from CSV.
The CSV to SQL converter turns CSV data into an optional CREATE TABLE statement plus INSERT statements for MySQL, PostgreSQL or SQLite. It can detect the delimiter, use the first row as column names and infer column types from the values. Use it to import spreadsheet exports into a database without writing the SQL by hand.
CSV is a plain-text table: each line is a row and the values on a line are separated by a delimiter, usually a comma. Quoted values can contain the delimiter or line breaks. SQL databases need typed columns and quoted values, so the converter parses the CSV, treats the first row as column names (if you leave First row is header ticked) and decides a type for each column from its values. Whole numbers become integers, decimals become floating-point, true and false become booleans, and everything else becomes text. Empty cells become NULL. Values that look like numbers but have a leading zero, such as the postal code 02134, are kept as text so the zero is not lost. The Dialect option sets type names, identifier quoting and boolean literals.
The CSV parser looks at the text and guesses the delimiter. If the guess is wrong for your data, choose Comma, Semicolon, Tab or Pipe explicitly.
An empty cell becomes NULL in the INSERT statement.
From all values in the column: whole numbers are integers (BIGINT when beyond the 32-bit range), decimals are floating-point, true and false are booleans, and anything else is text. A column mixing these becomes text or, for numbers only, floating-point.
Yes. Load a .tsv file, or paste tab-separated text and choose Tab (or leave Auto) as the delimiter.
No. Only the columns from your CSV are created, with no keys or constraints. Add them to the CREATE TABLE as needed.
No. Files and pasted text are read and converted in the page and are not sent anywhere.