JSONL to SQL
Turn a JSONL file into SQL you can run. Batched INSERT statements for PostgreSQL, MySQL or SQLite, with an optional CREATE TABLE whose column types are inferred from the values actually present. Nothing is uploaded.
Convert
Column types are inferred, not guessed at random
Every record is scanned before the DDL is written, so a column is only BIGINT if every value
in it is a whole number, and only NOT NULL if no record had a null or a missing key. Mixed
columns become TEXT, because failing to load is worse than a wide column.
Three things to check by hand before running the DDL in production:
- Money infers as a float. Change it to
NUMERIC(12, 2). - Large integers beyond 253 have already lost precision by the time JavaScript parses them. Keep big ids as strings in the JSONL.
- NOT NULL reflects your sample, not your data model.
Or skip SQL entirely
If the goal is to query the file rather than load it into a database, the SQL playground runs real SQL directly over your JSONL with DuckDB compiled to WebAssembly — joins, aggregates, window functions — with no server and no schema to define. This page is for when the destination genuinely is a database table.
Privacy
Nothing is uploaded. The whole thing runs in this tab, in your own browser. That matters here more than on most tool sites — training data is usually the most sensitive file a team owns.
Frequently asked questions
Why did a numeric column become TEXT?
Something in it is not a number — usually an empty string, a placeholder like "N/A", or a number formatted with separators. Field coverage shows the types present per field and will point at the culprit.
How large a batch should I use?
100 to 1,000 rows per statement is the sweet spot. Larger batches keep helping but eventually hit statement-size limits, and one huge statement means one huge rollback if anything fails.
Are broken lines skipped?
Yes, and the count appears in the status bar. Run the Auto-fixer first if there are many.
Does it generate an upsert?
Not on this page. jsontoolskit.org's JSON → SQL has upsert clauses; convert with JSONL → JSON first if you need them.