About the CSV → SQL playground

CSV → SQL converts comma-separated tabular data into SQL INSERT statements. The header row supplies the column names, and each data row becomes a VALUES tuple with strings quoted and numbers left bare. It's a fast way to load a spreadsheet export into a relational database without writing repetitive INSERT syntax by hand, and you can point the statements at any table name you choose.

CSV (Comma-Separated Values) is a plain-text tabular format defined loosely by RFC 4180, where lines are rows and commas separate fields. SQL (Structured Query Language) drives relational databases, and INSERT is the statement that adds rows. This converter reads the CSV header and rows and emits portable INSERT statements compatible with MySQL, PostgreSQL, SQLite, and SQL Server.

HostedCSV → SQL runtime
mainentry file
single fileworkspace
stdinprogram input

How it works

1

Write

The main file is the entry point for each run.

2

Give it input

Use the Input panel to pipe standard input to your program when it needs data.

3

Run

Run sends your code to a fresh hosted runtime and streams the result into the output panel.

4

Keep or share

Your draft stays in this browser, and Share creates a separate snapshot link.

Input (CSV)

id,name,active
1,Ada,1
2,Linus,0

Output (SQL)

INSERT INTO users (id, name, active) VALUES (1, 'Ada', 1);
INSERT INTO users (id, name, active) VALUES (2, 'Linus', 0);

Input (CSV with quotes)

sku,label
A100,"O'Brien's pick"

Output (SQL)

INSERT INTO products (sku, label) VALUES ('A100', 'O''Brien''s pick');

Input (CSV with nulls)

id,email,phone
1,[email protected],
2,,555-0102

Output (SQL)

INSERT INTO contacts (id, email, phone) VALUES (1, '[email protected]', NULL);
INSERT INTO contacts (id, email, phone) VALUES (2, NULL, '555-0102');

Input (CSV decimals)

id,product,price
1,Widget,9.99
2,Bolt,0.45

Output (SQL)

INSERT INTO items (id, product, price) VALUES (1, 'Widget', 9.99);
INSERT INTO items (id, product, price) VALUES (2, 'Bolt', 0.45);

Input (CSV comma in field)

id,city
1,"Paris, France"
2,Tokyo

Output (SQL)

INSERT INTO places (id, city) VALUES (1, 'Paris, France');
INSERT INTO places (id, city) VALUES (2, 'Tokyo');

Input (CSV batched)

id,name
1,Ada
2,Linus
3,Grace

Output (SQL batched)

INSERT INTO users (id, name) VALUES
  (1, 'Ada'),
  (2, 'Linus'),
  (3, 'Grace');

Input (CSV escaped quote)

id,quote
1,"say ""hi"""

Output (SQL)

INSERT INTO notes (id, quote) VALUES (1, 'say "hi"');

How it works

The editor uses Monaco, the engine behind VS Code, with language-aware editing tools and familiar keyboard controls.

Workflow

Paste CSV; the header row supplies SQL column names.

Each data row becomes one INSERT ... VALUES tuple.

Strings are quoted; numeric fields are emitted bare.

Options

Point the statements at any target table name you choose.

Output is portable across MySQL, PostgreSQL, SQLite, and SQL Server.

Quoting and escaping are applied so values stay valid SQL.

Privacy

Rows are converted locally; your spreadsheet data is never uploaded.

Suitable for exports containing private records.

Tips

Skip writing repetitive INSERT syntax for spreadsheet loads by hand.

Verify column order matches your table schema before running.

Every shortcut, searchable:

Editing

Undo
Ctrl+Z
Redo
Ctrl+⇧+Z
Select next occurrence
Ctrl+D
Delete line
Ctrl+⇧+K
Move line up / down
Alt+↑ / ↓
Copy line up / down
Alt+⇧+↑ / ↓
Toggle comment
Ctrl+/
Indent line
Ctrl+]
Outdent line
Ctrl+[

Navigation

Find
Ctrl+F
Find & replace
Ctrl+H
Go to line
Ctrl+G
Go to symbol
Ctrl+⇧+O

Selection

Select all
Ctrl+A
Select line
Ctrl+L
Select all occurrences
Ctrl+⇧+L
Shortcuts follow your OS — ⌘ becomes Ctrl on Windows and Linux.
It turns CSV rows into SQL INSERT statements, using the header row for column names and quoting each value by type.
No. The conversion happens in your browser, so your CSV is never sent to a server.
Yes, free with no account or usage limits.
Enter your table name in the provided field (or edit the output); it's applied to every generated INSERT statement.
Single quotes inside values are doubled (e.g. O'Brien becomes O''Brien) so the SQL stays syntactically valid.
plaintext
sql

Output

SQL INSERT statements

>_compilebytes

A fast place to write code and run it in isolated hosted runtimes. Free, forever.

Playgrounds

Python compilerC compilerJavaScript compilerC++ compilerTypeScript compilerGo compilerJava compilerRust compiler
All playgrounds →

Tools

JSON formatterRegex testerBase64 encoderJWT decoder
JSON formatterBase64 encoder & decoderRegex testerJWT decoder
All tools →

Company

TermsPrivacy[email protected]
© 2026 compilebytes115 runtimes · no signup115 runtimes · isolated sandboxes · no signup