UltKit

CSV to SQL Converter

Turn a spreadsheet export into a script your database can run. The header row names the columns, every line becomes an INSERT, and quoting follows the dialect you pick.

Data Converter

or drop CSV, TSV, TXT … files here ·

Max 95 MB per file· Up to 20 files· Deleted after 30 minutes

Output

Files are processed on our servers and deleted after 30 minutes.

How to use this tool

  1. 1

    Upload the CSV

    Add one CSV or up to 20, 95 MB each. Semicolon and tab files are detected automatically.

  2. 2

    Set table and dialect

    Under Advanced settings, type the SQL table name and choose the SQL dialect: MySQL, PostgreSQL, SQLite or SQL Server. Dates is set to ISO so date literals load without guessing.

  3. 3

    Convert and run

    Press Convert to SQL, read the CREATE TABLE line, then run the script in your database client or import screen.

CSV to SQL writes a CREATE TABLE statement from your header row and one INSERT per data row, quoted for MySQL, PostgreSQL, SQLite or SQL Server, so a spreadsheet loads into a database by running a single script.

Why turn a CSV into SQL INSERT statements

Every database has a fast CSV loader, and every one of them has a catch. LOAD DATA LOCAL INFILE is disabled by default on the server since MySQL 8.0, COPY FROM a file needs superuser rights or membership in a special role in PostgreSQL, and SQL Server's BULK INSERT reads paths on the server machine, not your laptop. Hosted databases often expose nothing but a query editor.

An INSERT script sidesteps all of that. It is text, so you can read it, commit it to version control as seed data, and run it in any client. The trade-off is speed: tens of thousands of rows load fine, while millions belong in a native bulk loader. Developers who keep reference data in a workbook can skip the CSV step with Excel to SQL.

CSV to SQL example for MySQL

Script generated from id,name,joined with two rows
CREATE TABLE `my_table` (
  `id` INT,
  `name` VARCHAR(255),
  `joined` DATE
);

INSERT INTO `my_table` (`id`, `name`, `joined`) VALUES
(1, 'Ana Ruiz', '2026-03-02'),
(2, 'Liam O''Brien', '2026-04-15');

How the four SQL dialects differ in the output

Identifiers are wrapped in backticks, as in order date, which also lets reserved words such as order serve as column names.

  • Fits MariaDB as well
  • Good default for phpMyAdmin imports
Database limits that affect a generated script
OrganisationRequirementSource
MySQL 8.0max_allowed_packet defaults to 64 MB; a single statement larger than that is refused—
SQL ServerOne INSERT … VALUES list accepts at most 1,000 row value expressions—
PostgreSQLIdentifiers longer than 63 bytes are silently truncated—
SQLiteA table has at most 2,000 columns in a default build—

Check these before you run the script

Read the CREATE TABLE line first. Column types are guessed from the values, and a guess can be wrong: ZIP codes and phone numbers look numeric but must stay text, or 02134 loses its leading zero. Change the type in the script before running it, or create the table yourself and run only the INSERT part.

Type the real name into SQL table name instead of my_table, and run the script inside a transaction where your client allows it, so one bad row rolls everything back. Other targets for the same CSV are on the data converter hub.

CSV and SQL script formats

CSV

Comma-separated values

CSV is a plain-text format for tables in which each line is a row and commas separate the columns. It has been used since the early days of computing and is described in RFC 4180, though many variants use semicolons or tabs and different text encodings. Nearly every spreadsheet, database and analytics tool can import and export it, which makes it the default format for moving data between systems. CSV stores only values, with no formulas, formatting, multiple sheets or data types.

Compression
–
Transparency
–
Animation
–
Introduced
–
CSV converter

SQL

SQL script

An SQL file is a plain-text script of Structured Query Language statements, such as CREATE TABLE and INSERT, that a database runs in order. It is commonly used for database backups, migrations and sharing sample data. The language itself is an ISO standard, but MySQL, PostgreSQL, SQLite and SQL Server each have their own dialects, so scripts often need small changes between systems. Any text editor can open an SQL file, and a database client is needed to execute it.

Compression
–
Transparency
–
Animation
–
Introduced
–
SQL converter

CSV becomes SQL when a file has to end up as a table in a database you can only reach through a query window: seeding a new app, loading a reference list or moving a spreadsheet into MySQL or PostgreSQL without server access.

CSV to SQL converter questions

Why use a SQL file instead of LOAD DATA or COPY?

Bulk loaders such as MySQL's LOAD DATA INFILE and PostgreSQL's COPY are faster but need file access on the server or extra client flags. A plain script runs anywhere you can paste SQL: a cloud database console, phpMyAdmin or a reviewed migration.

How are apostrophes in names like O'Brien written?

Inside a SQL string a single quote is escaped by doubling it, so the value is written as 'O''Brien'. All four dialects accept that form, which is why a name with an apostrophe does not break the INSERT.

What do my CSV headers become in the table?

Column names, quoted the way the chosen dialect expects. Headers like Unit Price work, but a quoted name with a space has to be quoted in every later query too, so rename such headers to unit_price before converting if you can.

Can I import the SQL file through phpMyAdmin?

Yes, on the Import tab. The ceiling there is PHP's upload_max_filesize, which is 2 MB in a stock php.ini; many hosts raise it, and the page shows the current limit. Split a large CSV into several files if the script is bigger than that.

Is there a way back from a table to CSV?

Export the table as a dump and convert it with SQL to CSV, or use your database client's own CSV export. Both give you rows a spreadsheet can open again.