---
title: "CSV to SQL Converter: PostgreSQL, MySQL, SQLite"
description: "Free CSV to SQL converter: paste CSV, get CREATE TABLE and INSERT for PostgreSQL, MySQL or SQLite. Types detected, names and strings quoted. No upload."
canonical: "https://browser-use.com/tools/csv-to-sql"
last_updated: "2026-11-23"
---

# CSV to SQL Converter: PostgreSQL, MySQL, SQLite

## CSV to SQL Converter

Convert CSV to CREATE TABLE and INSERT statements for PostgreSQL, MySQL or SQLite. Column types are detected and values quoted for each database.

## How it works

### Paste or open a CSV

Paste CSV, open a file up to 5 MB, or drop one on the box. Comma, semicolon or tab is detected.

### Pick the database

PostgreSQL, MySQL or SQLite. Check the column types; turn off Detect types to make every column text.

### Run it

Copy the SQL or download a .sql file, then run it with psql, mysql or sqlite3.

### How are quotes and backslashes written?

A ' in a value is doubled in all three. MySQL also reads a backslash as an escape, so for MySQL C:\\path is written C:\\\\path. PostgreSQL and SQLite keep backslashes as they are.

Source: [MySQL: string literals](https://dev.mysql.com/doc/refman/8.4/en/string-literals.html) · [PostgreSQL: string constants](https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-STRINGS) · [SQLite: literal values](https://www.sqlite.org/lang_expr.html#literal_values_constants_)

### Why does a zip code like 00123 stay text?

As a number it would load as 123. A column gets a number, boolean or date type only when every value fits it exactly. 2026-02-30 is not a date, so its column stays text.

### What happens to headers like select or first name?

Reserved words and names with spaces or capitals are quoted: "select" for PostgreSQL and SQLite, \`select\` for MySQL. Empty and repeated names are renamed and listed.

Source: [PostgreSQL: key words](https://www.postgresql.org/docs/current/sql-keywords-appendix.html) · [MySQL: keywords](https://dev.mysql.com/doc/refman/8.4/en/keywords.html) · [SQLite: keywords](https://www.sqlite.org/lang_keywords.html)

### Why no DATE type for SQLite?

SQLite has no date type, so dates stay text as written. Its date functions read ISO dates like 2026-11-23.

Source: [SQLite: datatypes](https://www.sqlite.org/datatype3.html) · [SQLite: date functions](https://www.sqlite.org/lang_datefunc.html)

### Is my CSV uploaded?

No. Conversion runs in this tab.

## Need the data from a website first?

Browser Use agents open pages in a real browser, including dynamic ones, and return structured data.

[See AI web scraping](https://browser-use.com/web-scraping)

3 rows, 7 columns

CSVid,name,zip,signup\_date,active,balance,note 1,Ada Lovelace,02134,2026-11-02,true,1250.50,"Prefers email, not phone" 2,Lin O'Brien,10001,2026-11-03,false,,"Said ""call after 9""" 3,Sam Wu,94105,2026-11-04,true,-20.75,

Load exampleOpen .csv file

Runs in your browser, files up to 5 MB. Nothing is uploaded.

217 B · comma\-separated (detected)

Database

PostgreSQLMySQLSQLite

Table nameDelimiterDetectCommaSemicolonTabRows per INSERT11005001,0005,000Empty text cellsNULLEmpty string ''

Header rowDetect typessnake\_case namesCREATE TABLEDROP IF EXISTSBEGIN / COMMITCOPY (psql)

Strings and names are quoted as [the database](https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-STRINGS) reads them. A column gets a type only when every value fits it.

## PostgreSQL · 3 rows · 7 columns

Copy SQLDownload .sql

Column

Type

id

INTEGER NOT NULL

name

TEXT NOT NULL

zip

TEXT NOT NULL

signup\_date

DATE NOT NULL

active

BOOLEAN NOT NULL

balance

NUMERIC

note

TEXT

CREATE TABLE data (
  id INTEGER NOT NULL,
  name TEXT NOT NULL,
  zip TEXT NOT NULL,
  signup\_date DATE NOT NULL,
  active BOOLEAN NOT NULL,
  balance NUMERIC,
  note TEXT
);

BEGIN;
INSERT INTO data (id, name, zip, signup\_date, active, balance, note) VALUES
  (1, 'Ada Lovelace', '02134', '2026-11-02', TRUE, 1250.50, 'Prefers email, not phone'),
  (2, 'Lin O''Brien', '10001', '2026-11-03', FALSE, NULL, 'Said "call after 9"'),
  (3, 'Sam Wu', '94105', '2026-11-04', TRUE, -20.75, NULL);
COMMIT;

---

BROWSER USE

- Browser Use Agents: give Browser Use a task and receive completed work. API V4 is current for new integrations.
- Browser Infrastructure: connect your agent or automation to managed browsers through SDK, REST, or CDP. Starts at $0.06/browser-hour.
- Developer tools: Open Source, Browser Harness, SDK, and MCP support the two products above.

[Developer Index](https://browser-use.com/index.md)
[Product Map](https://browser-use.com/llms.txt)
[Full Product Context](https://browser-use.com/llms-full.txt)
[Pricing](https://browser-use.com/pricing.md)
[Cloud Docs](https://docs.browser-use.com/cloud/quickstart)
[Open Source Docs](https://docs.browser-use.com/open-source/introduction)
