SQL Result to CSV / JSON Exporter
Convert SQL query results (pasted result grids, INSERT statements, or Markdown tables) to CSV, JSON, NDJSON, TSV, Markdown, or HTML. Smart type inference (int/decimal/boolean/date/NULL), BigInt-safe numerics, escaped quotes, per-column rename/reorder/select, configurable CSV delimiter + quoting. Round-trips with CSV→SQL. 100% client-side.
About SQL Result to CSV / JSON Exporter
Convert SQL query results (pasted result grids, INSERT statements, or Markdown tables) to CSV, JSON, NDJSON, TSV, Markdown, or HTML. Smart type inference (int/decimal/boolean/date/NULL), BigInt-safe numerics, escaped quotes, per-column rename/reorder/select, configurable CSV delimiter + quoting. Round-trips with CSV→SQL. 100% client-side. Everything runs locally in your browser — your data never leaves your device.
How to use
- Enter your input in the tool above.
- Adjust any options to your preference.
- Use the Copy or Download buttons to save the result.
- Everything happens locally — your data never leaves your browser.
FAQ
What input formats does the SQL Result Exporter accept?
Three: (1) pasted result grids (tab-separated from DBeaver/psql, pipe-separated like MySQL CLI, comma-separated, or whitespace-aligned); (2) INSERT statements — single-row ('INSERT INTO t (a,b) VALUES (1,2)') or multi-row ('VALUES (1,2),(3,4)'); and (3) Markdown tables. The input format is auto-detected, with a manual override.
How does the tool preserve data types?
For each column we sample every non-NULL value and check whether it consistently looks like an integer (including BigInt-safe integers up to 2^53), a decimal, a boolean (true/false/0/1), a date (YYYY-MM-DD or ISO datetime), or NULL. Otherwise we treat it as text. Inferred types drive the JSON output: numbers stay numbers, booleans stay booleans, NULLs become null, dates can be reformatted, and strings stay strings.
How are NULL vs 'NULL' string handled?
The literal token 'NULL' (case-insensitive, unquoted) is interpreted as a true NULL — emitted as null in JSON, empty in CSV (configurable), and \N in TSV by default. The quoted token 'NULL' (i.e. 'NULL' wrapped in single quotes inside an INSERT) is treated as the literal string 'NULL'. You can configure the NULL token (e.g. '\\N' for PostgreSQL COPY) and toggle whether empty cells become NULL or empty strings.
What output formats are supported?
Six: CSV (RFC 4180 with configurable delimiter and quoting), JSON (array of objects — types preserved), NDJSON (one JSON object per line), TSV (tab-separated), Markdown table, and HTML table. All formats round-trip cleanly downstream and respect per-column rename/reorder/select.
What extra features does this tool have versus others?
(1) Multi-format input — grids, INSERTs, Markdown. (2) Six output formats — CSV/JSON/NDJSON/TSV/Markdown/HTML. (3) Smart per-column type inference with BigInt safety. (4) NULL vs 'NULL'-string disambiguation. (5) Per-column rename / reorder / select. (6) Configurable CSV delimiter (comma/semicolon/tab/pipe) and quoting (always/never/auto). (7) Optional date reformatting. (8) RFC 4180-correct CSV with embedded-quote/comma/newline escaping. (9) Round-trip with #274 (CSV→SQL). (10) Live preview grid with type badges. (11) localStorage history (max 20). (12) Shareable URL config. (13) Copy / download. 100% offline — no upload.
Related tools
.bashrc / .zshrc Alias & Config Manager
Build shell aliases, functions, exports, and PATH edits in a visual editor, then export a clean, commented .aliases file sourced from both .bashrc and .zshrc — with shadowing detection against shell builtins and common CLI tools, function suggestions when args are needed, starter packs (git, docker, kubectl, navigation, safety, ls, dev, devops, data science), import of existing rc files, dedupe, history (localStorage), and shareable URL. 100% client-side.
Add / Subtract Date Calculator
Add or subtract years, months, weeks, days, hours, minutes and seconds from a starting date/time. Calendar-day or business-day mode with custom weekend + holiday list. Month-end policy toggle (clamp to last day vs overflow). Repeat/series mode (e.g. every 2 weeks x 10) with CSV export. Shareable URL. 100% client-side.
Age Calculator
Calculate exact age from a birth date in calendar years/months/days (no negative-day bugs) plus totals in months/weeks/days/hours/minutes/seconds. Next-birthday countdown with weekday. Feb-29 birthday policy toggle. Milestones (1,000 days, 10,000 days, 1 billion seconds). Zodiac sign + Chinese zodiac. Age gap comparison. Shareable URL. 100% client-side.