Convert CSV or TSV input to JSON, SQL inserts, Markdown table, or TypeScript types. Single HTML file. Browser-only.
Live demo: https://0xelitesystem.github.io/csv-to-anything/
You hit this loop constantly: get a CSV from someone, need it as JSON for an API, or as SQL inserts for a database, or as a Markdown table for a doc, or as TypeScript types for a typed codebase. Most tools do exactly one of these. This does all four, instantly, in one file.
It is a single HTML file with no tracking and no network calls, and it is MIT licensed.
Open index.html in any browser, or visit the hosted demo at https://0xelitesystem.github.io/csv-to-anything/ once Pages is enabled.
- Paste CSV or TSV into the left panel.
- Pick a delimiter (auto-detect works for most cases) and whether the first row is a header.
- Switch tabs in the right panel: JSON, SQL, Markdown, TypeScript.
- Copy or download.
Type inference runs per column based on the data. Recognized types:
integer(matches/^-?\d+$/)number(matches/^-?(?:\d+(?:\.\d+)?|\.\d+)$/)boolean(exactlytrue,false,TRUE,FALSE,yes,no,Y,N,0,1; the match is case sensitive, soTrueandYESstay strings)date(anything starting withYYYY-MM-DD)string(everything else)
A digit string only counts as integer or number if the JS number renders back to the same text. That keeps 01234 and 12345678901234567890 as strings instead of turning them into 1234 and a rounded id.
Empty cells become null in JSON, NULL in SQL, blank in Markdown, and null is included as a permitted value in TypeScript types.
JSON: pretty-printed array of objects, type-coerced.
SQL: INSERT INTO "<table>" (...) VALUES (...); per row. Identifiers double-quoted, strings single-quoted with '' escape. Booleans become TRUE/FALSE. The output includes a header comment reminding you to review before running on a live database.
Markdown: padded table with | separators and a - rule row. Column widths auto-compute from header and data. A | inside a cell is backslash-escaped and a newline inside a cell becomes <br>, so one CSV row always stays one table row.
TypeScript: export interface ${name} { col: type | null; }. Property names are quoted only if they're not valid identifiers, and quoted names are escaped as JS string literals.
The parser handles:
- Quoted fields with
" - Escaped quotes inside fields (
""becomes") - Embedded newlines inside quoted fields
\r\nand\nline endings- Trailing empty rows
It does NOT handle:
- BOM (byte order mark), strip before pasting if your CSV has one
- Excel-specific quirks like leading
=formulas
- Single HTML file, ~390 lines
- Vanilla JS, no frameworks, no dependencies, no build
- Light and dark themes with OS preference detection
- WCAG AA contrast on both themes
- Tested in current Chrome, Firefox, Safari
- Doesn't upload your data anywhere. Everything runs locally.
- Doesn't validate SQL against your actual schema. The output is a starting point.
- Doesn't infer JSON Schema. Use
json-to-typescriptor a dedicated tool for that. - Doesn't streaming-process huge files. Targeted at human-scale CSVs (< 100k rows).
Everything runs in your browser. The page makes no network requests, loads no external scripts or fonts, and has no analytics or tracking. The CSV you paste never leaves your machine. The one thing the page saves is your light or dark theme choice, written to localStorage under the key theme when you press the theme toggle. Clearing site data removes it.
git clone https://github.com/0xelitesystem/csv-to-anything
cd csv-to-anything
Then open index.html in any modern browser, or serve the folder with python -m http.server and visit http://localhost:8000/.
No build step. The whole tool is one index.html file with inline CSS and JavaScript, and there is nothing to install or compile.
Part of a catalog of single-file browser tools and plain-language references, all MIT licensed and dependency-free: 0xelitesystem.github.io. Built by elitesystem.ai.
MIT. See LICENSE.
- json-to-typescript, the inverse direction, JSON to TS
- regex-tester-with-explainer, test regex patterns
- og-image-generator, generate Open Graph cards
- single-file-saas-template, ship a SaaS in one HTML file