Excel or CSV file to ready-to-run database INSERT commands
Convert a CSV file or Excel export into ready-to-run SQL commands. You get one CREATE TABLE command and an INSERT row for each record. The first row in the file is read as column names, and each column is assigned a type based on its content: INTEGER for whole numbers, NUMERIC for decimals, and TEXT for everything else. Empty cells become NULL, and single quotes inside text are doubled so the command does not break. You choose the table name yourself, and then copy the result or download it as a .sql file. The file is read in the browser and is never uploaded to any server.
A single quote inside a text value is doubled ('') according to the SQL standard, so the command does not break. Numeric columns are written without quotes, and an empty cell is written as NULL.
The tool reads the file in UTF-8 encoding. A CSV file saved in Excel with the old Windows encoding will show corrupted letters. You should save it in Excel as a CSV UTF-8 format and upload it again.
It checks all values in the column. If all are whole numbers, it assigns INTEGER. A mix of whole and decimal numbers gets NUMERIC. A single non-numeric value turns the column into TEXT. Note that a phone number like 0501234567 will be considered a whole number, and the leading zero might be lost in the database.
Spaces and special characters in a column name are replaced with an underscore, and an unnamed column gets a name like col_3. Hebrew letters are kept exactly as they are.
You can upload a file up to 40MB. The display only shows the first 20,000 characters of the commands, and the full file is available via download.
Klix could not load
Try reloading the page first. If a new version just went out, a reload fixes it straight away.
If reloading did not help, your browser may be too old. Klix runs the tools on your own device rather than on a server, so it needs a browser from 2022 or later. What to do: update Chrome or Firefox, then open klixtools.com again.