CSV to SQL Converter

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.

Frequently asked questions

What about values with quotes and special characters?

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.

Why does Hebrew text in the file look like gibberish?

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.

How does the tool determine the column type?

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.

What happens to column names with spaces?

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.

Is there a file size limit?

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.

More tools you might need

All tools in Developers and AI