Private browser utility / Developer

CSV to SQL Converter

Runs entirely in your browser - no upload, no sign-up.

Live workspaceLocal processing
CSV in. SQL out. On your device.

One table name, up to 63 UTF-8 bytes. Names are quoted exactly; schema prefixes are not interpreted.

CSV and SQL options

Text is the default. Inference checks every row: only unquoted signed 64-bit integers and lowercase true/false become typed values. Leading-zero IDs, decimals, dates and quoted values stay text.

Quoted empty strings remain empty strings. The word NULL is always text. Whitespace is preserved.

UTF-8 CSV, TSV or TXT. Up to 2 MiB, 10,000 rows, 100 columns and 200,000 cells.

Ctrl / Cmd + Enter
Share this tool
csv to sql / browser utility
01 / Overview

How do I convert CSV to SQL?

Paste CSV or open a UTF-8 file, choose PostgreSQL, MySQL or SQLite, and generate a SQL script. This CSV to SQL converter writes quoted CREATE TABLE and INSERT statements on your device. Columns stay text by default, preserving leading-zero IDs and exact decimal strings until you choose to infer types.

02

How to use

  1. 01
    Add your CSV

    Paste CSV, open a local CSV or TSV file, or load the example. The first row supplies column names by default.

  2. 02
    Choose the SQL output

    Choose your SQL dialect and table name. Open CSV and SQL options to change delimiters, batching, type inference or empty-cell handling.

  3. 03
    Generate and review

    Select Generate SQL. Review the output and column types, then copy the complete script or download the .sql file.

  4. 04
    Run in your database client

    Run the reviewed script in your own database client using a UTF-8 connection. This page never connects to a database.

03

Who it's for

  • Create a small development seed dataset from a spreadsheet export.
  • Preserve postal codes and customer IDs such as 00123 as database text.
  • Prepare INSERT statements for an existing table without adding CREATE TABLE.
  • Compare generated scripts for PostgreSQL, MySQL and SQLite before importing.

Preserve values before choosing types

CSV stores fields, not a database schema. The default keeps every value as text, including dates, decimals and the word NULL. Optional inference scans the entire column and accepts only unquoted signed 64-bit integers or lowercase true/false. A quoted numeric value, leading zero, decimal or out-of-range integer keeps that whole column as text. Review the result against your target schema.

Empty strings and SQL NULL are different

By default, an empty CSV cell becomes an empty SQL string. The NULL option changes only unquoted empty cells. A quoted empty field stays an empty string, and spaces are never trimmed. Blank physical records are skipped. Ragged rows, duplicate headers and malformed quoting stop conversion instead of silently dropping values.

FAQ

Is my CSV uploaded to a server?

No. File reading, CSV parsing and SQL generation run in your browser. The converter does not send your dataset to a server or connect to a database. Copy and download use the script generated on your device.

Is this CSV to SQL converter free?

Yes. You can paste data, open files and download SQL without an account or payment. There is no database connection to configure. You need your own database client to execute the generated script after reviewing it.

What are the file and row limits?

Input is limited to 2 MiB of UTF-8 text, 10,000 data rows, 100 columns and 200,000 total cells including headers. Generated SQL is capped at 12 MiB. Larger imports are better handled with a database bulk loader. The on-page preview is shortened after 60,000 characters; exports remain complete.

Can I generate SQL for MySQL, PostgreSQL and SQLite?

Yes. Each dialect gets its own identifier quoting, string handling and column types. Text maps to LONGTEXT with utf8mb4 in MySQL and TEXT elsewhere. Inferred integers use BIGINT in PostgreSQL and MySQL, or INTEGER in SQLite. Inferred SQLite booleans use integer 1 and 0.

Will leading zeros and large numbers be preserved?

Yes, in the default text mode. Optional inference also leaves leading-zero values, decimals and integers outside the signed 64-bit range as text. Integer conversion uses the original decimal digits rather than JavaScript floating-point numbers. Existing table types can still coerce values when you run the script.

How do I handle CSV without a header?

Turn off First row contains column names. The converter creates column_1, column_2 and so on, and treats the first record as data. With headers enabled, names are kept exactly and quoted. Blank, duplicate, overly long or unsupported names must be corrected before export.

Does this tool create a SQLite database file?

No. It downloads a UTF-8 .sql text script, not a database file. Execute that script using SQLite or your chosen database client. The tool does not infer decimal precision, dates, primary keys, indexes or relationships, and it does not check an existing database schema.