What changes when data is converted between JSON, CSV, YAML and XML?
The four formats model data differently: JSON and YAML carry nesting and types, CSV is a flat table of strings, and XML distinguishes elements from attributes. A converter therefore has to make choices — how to flatten nested objects into columns, how to type "42" and "true", where attributes go — and the right choice depends on what the receiving system expects.
How to use CSV to SQL
- Paste the CSV (header row required).
- Set the table name, dialect, primary key and batch size.
- Copy the DDL and INSERT statements into your migration or seed script.
CSV to SQL features
- Detects the delimiter (comma, semicolon, tab, pipe) automatically
- Infers INT, BIGINT, DECIMAL, BOOLEAN, DATE, TIMESTAMP, UUID and VARCHAR(n)
- Generates CREATE TABLE with NOT NULL and an optional PRIMARY KEY
- Batched multi-row INSERTs with dialect-correct literals
- Column names normalised to safe snake_case identifiers
- Schema table shows every inferred type for review
CSV to SQL example
Infer a schema
Input:
id,email,signed_up,score
1,layla@example.com,2026-03-14,87.5Output:
CREATE TABLE IF NOT EXISTS users (
id INT NOT NULL,
email VARCHAR(40) NOT NULL,
signed_up DATE NOT NULL,
score DECIMAL(3,1) NOT NULL
);
INSERT INTO users (id, email, signed_up, score) VALUES
(1, 'layla@example.com', '2026-03-14', 87.5);Frequently asked questions about CSV to SQL
How are column types inferred?
Every value in a column is inspected. Integers become INT/BIGINT, decimals DECIMAL(p,s), true/false BOOLEAN (or BIT/TINYINT(1)), ISO dates DATE/TIMESTAMP, UUIDs UUID/CHAR(36), and the rest VARCHAR with headroom: twice the longest value, rounded up to a multiple of 10 and capped at 4000. Mixed columns fall back to text.
What happens to column names with spaces or symbols?
They are converted to snake_case identifiers ("Order ID" → order_id) and quoted when they collide with reserved words. The schema table shows the mapping.
Can I skip CREATE TABLE?
Yes, untick "Include CREATE TABLE" when the table already exists.
Is there a size limit?
Files up to 2 MB are processed in the browser. For larger imports, use your database's native bulk loader (LOAD DATA, COPY, BULK INSERT).
References
- RFC 8259: The JavaScript Object Notation (JSON) Data Interchange FormatThe JSON grammar: objects, arrays, strings, numbers, the three literals, and UTF-8 as the interchange encoding.
- RFC 4180: Common Format and MIME Type for Comma-Separated Values (CSV) FilesThe commonly implemented CSV rules: comma separators, CRLF line ends, quoting of fields that contain commas, quotes or line breaks.
- YAML Ain't Markup Language (YAML™) version 1.2.2The YAML 1.2 data model and syntax, and its relationship to JSON (every JSON document is valid YAML 1.2).
- PostgreSQL Documentation: SQL SyntaxLexical structure of SQL in PostgreSQL: identifiers, quoting, string constants and escaping.