CSV to SQL converter
Paste your CSV — or upload a CSV or Excel file — and get a CREATE TABLE plus the INSERT statements to fill it, for PostgreSQL, MySQL, SQL Server or SQLite. Column types are inferred from your values rather than guessed from the header. Free, no signup, and the file is read in this browser tab — it is never uploaded.
How it works
- Paste CSV text, or choose a
.csv,.tsvor.xlsxfile — every worksheet in a workbook becomes its own table. - The first row is read as the column names. Duplicate and blank headers are made unique so the DDL still runs.
- Each column's type is inferred from the first 500 data rows, and a column is only marked
NOT NULLwhen the file has no blank in it. - Pick your dialect, then copy the SQL or download it as a
.sqlfile.
Read the types before you run it
Type inference reads what is in the file, and a file does not know what it means. Two kinds of value are deliberately left as text rather than guessed at: anything with a leading zero, so ZIP codes and account numbers survive intact, and any date written with slashes, because 03/04/2024 is 3 April or 4 March depending on who exported it. That still leaves what the guards cannot catch — an identifier without a leading zero, like a nine-digit account number or an EAN, is indistinguishable from a quantity and comes out numeric, and a column holding only whole numbers here can still be a decimal in the source system. Those two are visible in the generated CREATE TABLE, which is why the DDL is printed rather than hidden: change the type there before you run it, or paste the corrected DDL into the data dictionary generator to document what each field is supposed to be.
Loading the spreadsheet was never the point
You are converting this file because the questions you want to ask it are ones a spreadsheet answers badly. The thinking that follows — first answer, next question — is yours, and no tool takes it off you. What Intellrise takes off you is the retyping in between: connect the table you just loaded, or the Google Sheet you were about to convert, ask in plain English, and get the chart back. Every result carries a Show SQL toggle with the query it actually ran, because a number you cannot check is not an answer.
Intellrise is an AI data analyst for your own database or spreadsheet: ask in plain English, get charts, dashboards and reports back. Every new account starts on a 14-day Pro trial with no card — nothing to enter, nothing to cancel — and lands on a permanently free tier after it lapses. Every plan, the trial included, runs on your own AI provider key; a Google Gemini key is free to create.
Frequently asked questions
No. The CSV is parsed, and the Excel workbook is read, by JavaScript running in this browser tab — there is no request carrying your data, no account and no login. Close the tab and nothing of it remains.
PostgreSQL, MySQL/MariaDB, SQL Server, SQLite and a generic ANSI form. The dialect changes three things that actually break scripts: how identifiers are quoted (double quotes, backticks or square brackets), the column types, and how booleans are written (TRUE/FALSE against 1/0). SQL Server has no CREATE TABLE IF NOT EXISTS, so that option is left out of its output rather than written as something that will not run.
From the values, not the header. A column is an integer only if every sampled non-empty value is one, a number if they all parse as decimals, a boolean if they are all true/false/yes/no, a date only if they are all ISO (2026-08-04) — otherwise text. It samples the first 500 rows. Two cases are held back on purpose. A value with a leading zero (00501, 01234) is treated as text, so ZIP codes and account numbers keep their zeros instead of quietly becoming smaller numbers. And a slash date is treated as text, because 03/04/2024 is 3 April or 4 March depending on who exported the file and nothing in the file says which — typing it as a date would hand that guess to whatever date order the target database is configured for, and that mistake does not show up in the DDL, since the DDL would be right and only the values wrong. It round-trips as text exactly, and you can cast it once you know the convention. What it still cannot know: an identifier that has no leading zero — a nine-digit account number, an EAN — looks exactly like a number and will be typed as one, and a column that happens to hold only whole numbers in this export can still be a decimal in the source system. Both of those are visible in the CREATE TABLE, which is why it is printed rather than hidden.
They become NULL, and a column is written NOT NULL only when the file contains no empty value for it. If an empty cell in your data means zero or an empty string rather than unknown, fix that in the file first — SQL cannot tell the difference.
Yes. Each worksheet becomes its own table, named after the sheet. Names are lower-cased and non-alphanumeric characters become underscores, so a sheet called "Q3 Orders (final)" becomes q3_orders_final.
It is bounded by your browser tab's memory rather than by an upload limit, because there is no upload. Tens of thousands of rows are fine on a normal laptop; a file in the hundreds of megabytes is not what this tool is for — load that with your database's own bulk loader (COPY, LOAD DATA INFILE, bcp) using the CREATE TABLE this tool gives you.
Then use the data dictionary generator instead — same parser, but it produces a tables-and-columns reference with a place to write down what each field means, exportable as CSV or Markdown.