CSV to JSON Converter Online – TSV Viewer, Markdown & SQL Export | Free

Parse CSV and TSV in the browser: delimiter and header auto-detect, spreadsheet-style grid with sort, filter, and dedupe. Export to JSON, JSONL, Markdown tables, SQL INSERT, TSV, or CSV. UTF-8 default with UTF-16 Excel support. Import JSON arrays and JSONL. No upload.

What is the CSV / TSV Table Viewer & Converter?

CSV (Comma-Separated Values) and TSV (Tab-Separated Values) are the most common formats for exchanging tabular data — spreadsheet exports, database dumps, analytics reports, log aggregations, and API responses saved to disk. This free online tool parses CSV, TSV, and related delimited text in your browser, shows a sortable spreadsheet-style preview grid, and exports to JSON, JSONL, Markdown tables, SQL INSERT statements, TSV, or CSV — with no upload and no server round-trip.

Unlike opening a file in Excel or Google Sheets, you get instant format conversion, column-level sorting and hiding, row search and deduplication, and copy-ready output for scripts, documentation, or SQL migrations — all from a single paste or drag-and-drop. Parsing follows RFC 4180 rules: quoted fields, embedded commas, and multiline cell values inside double quotes are handled correctly.

Everything runs locally in WebAssembly (Rust compiled to WASM). Your data never leaves the browser.

Why Use an Online CSV Viewer and Converter?

  • Quick inspection: Paste a CSV snippet from a log, email, or terminal and see a clean grid without opening a spreadsheet app.
  • Format conversion: Turn CSV into JSON for REST APIs, JSONL for streaming pipelines, Markdown for README docs, or SQL INSERT for database seeding.
  • Analytics exports: Google Analytics and similar tools export CSV with # comment lines, two-row merged headers, and summary rows — import options strip noise and build proper column names.
  • Privacy: Sensitive customer or production data stays on your machine. No cloud upload required.
  • Bidirectional JSON: Import JSON arrays or JSONL back into a table view, then re-export as CSV or TSV.

How to Use — Step by Step

Basic CSV → JSON conversion

  1. Switch Input Method to TEXT (default) or FILE to upload a file.
  2. Paste or upload tabular data — for example:
name,age,city
Alice,30,NYC
Bob,25,LA
  1. Leave Delimiter on Auto (comma detected) and Header row on Auto-detect.
  2. Set Output format to JSON in the Export section.
  3. The Preview grid shows 2 rows × 3 columns; the Result panel shows a JSON array. Click the textarea to copy, or use Download to save export.json.

FILE mode — upload a spreadsheet export

  1. Set Input Method to FILE.
  2. Drag-and-drop or choose a .csv, .tsv, .txt, or .json file (max 5 MB).
  3. For Excel CSV UTF-16 exports, set File encoding to UTF-16 LE or UTF-16 BE. UTF-8 with BOM is auto-detected.
  4. Adjust Parse & display options if needed, then pick an export format.

Input Settings

Input Method — TEXT vs FILE

  • TEXT: Paste directly into the textarea. Parsing runs on every keystroke. Use Clear to reset input, grid, and result.
  • FILE: Drag-and-drop or Choose file. Supported extensions: .csv, .tsv, .txt, .json, .jsonl. Max file size: 5 MB. Settings persist in browser localStorage.

File encoding (FILE mode)

Choose how raw bytes are decoded before parsing:

  • UTF-8: Default. BOM (Byte Order Mark) at the start of the file is stripped automatically.
  • UTF-16 LE: Little-endian UTF-16, common for Excel "CSV UTF-16" exports on Windows.
  • UTF-16 BE: Big-endian UTF-16, occasionally seen in cross-platform exports.

Legacy locale encodings (EUC-KR, GBK, Shift_JIS, Windows-1252, etc.) are not supported. Re-save the file as CSV UTF-8 in Excel or Google Sheets if characters appear garbled.

Parse & Display Options

These settings control how delimited text is interpreted and how the preview grid behaves. All options except File encoding apply to TEXT and FILE input.

Delimiter

  • Auto: Samples the first 20 lines and picks the delimiter (comma, tab, semicolon, or pipe) with the most consistent column count per row.
  • Comma (,): Standard CSV.
  • Tab (TSV): Tab-separated values — common for Unix tools and cut -f pipelines.
  • Semicolon (;): European Excel default when the locale uses comma as decimal separator.
  • Pipe (|): Pipe-delimited logs and database exports.

Header row

Controls whether the first data row becomes column names. Only used when Header rows (N) is set to Off.

  • Auto-detect: Treats the first row as a header when it looks textual and the second row looks more numeric, or when column names repeat. Single-column all-text files are treated as data without a header.
  • Has header row: Always use row 1 as column names; data starts at row 2.
  • No header: All rows are data; columns are named col1, col2, …

Search rows

Case-insensitive filter across all columns. Matching is substring search — typing Gadget in a product column shows only rows containing that text. Search applies to both the preview grid and the export output.

Dedupe rows

When enabled, removes duplicate rows (full-row comparison) from the preview and export. Useful after joins or log merges where identical lines appear more than once.

CSV / TSV Import Preprocessing

These three options apply only to the CSV/TSV parsing path. They are not applied when input is detected as JSON (array starting with [) or JSONL (multiple {...} lines).

Skip `#` lines

Removes rows whose first non-empty cell starts with #. Analytics tools, custom exporters, and config dumps often prepend metadata lines like # Report title or # 2026-01-01 to 2026-03-01 before the actual table.

Skip empty key

Skips data rows where the first column is empty. Google Analytics page-path exports use an empty first cell for country subtotals and grand-total rows (e.g. ,6071.01,13650,... summary line). Enable this to keep only rows with a page path in column 1.

Header rows (N)

Merges the first N rows into hierarchical column names, then treats row N+1 as the first data row. Each header row is forward-filled horizontally (empty cells inherit the value from the left, like Excel merged headers), then layers are joined per column with / .

Two-row header example (Google Analytics style):

,United States,United States,Canada,Canada
Page path,Revenue,Events,Revenue,Events
/endian/,1140.95,2741,37.26,166

With Header rows: 2, column names become:

  • Col 1: Page path
  • Col 2: United States / Revenue
  • Col 3: United States / Events
  • Col 4: Canada / Revenue
  • Col 5: Canada / Events

Set N to Off to fall back to the Header row setting instead. Supported values: Off, 1, 2, 3, 4, or 5 rows.

Recommended settings for Google Analytics CSV exports

  1. Enable Skip `#` lines — removes # metadata rows at the top.
  2. Set Header rows (N) to 2 rows — merges country/region row with metric names.
  3. Enable Skip empty key — drops total/summary rows with an empty first column.
  4. Leave Delimiter on Auto and export as JSON or Markdown for further analysis.

Preview Grid

After successful parsing, a paginated table shows the current view (after search, dedupe, sort, and hidden columns).

  • Sort: Click a column header to sort ascending; click again for descending; a third click clears sort. A icon hints that the column is sortable.
  • Hide column: Click the eye-slash icon on a header to hide that column from the grid and export.
  • Pagination: Choose 25, 50, 100, or 200 rows per page. The badge shows total filtered rows × visible columns.
  • Row cap: Up to 50,000 rows are loaded; larger files show a truncation notice.
  • Parse warnings: RFC 4180 issues (e.g. unclosed quotes) are listed without stopping the entire parse when possible.

Export Formats

The Result panel reflects the current grid state (search, dedupe, sort, hidden columns). Click the textarea to copy; use Download to save a file.

JSON

Array of objects — one object per row, keys from column headers:

[
  { "name": "Alice", "age": "30", "city": "NYC" },
  { "name": "Bob", "age": "25", "city": "LA" }
]

JSONL

Newline-delimited JSON — one object per line. Ideal for log ingestion, BigQuery loads, and streaming ETL.

Markdown Table

GitHub-flavoured Markdown pipe table with a header separator row. Paste directly into README files, Notion, or GitLab wikis.

SQL INSERT

Set SQL table name (default records) in Export settings:

INSERT INTO records (name, age, city) VALUES ('Alice', '30', 'NYC');
INSERT INTO records (name, age, city) VALUES ('Bob', '25', 'LA');

String values are single-quoted with internal quotes escaped. Review before running against production databases.

TSV and CSV

Re-export as tab- or comma-separated text. Useful after cleaning, deduplicating, or hiding columns. Delimiter for re-export follows the Output format (tab for TSV, comma for CSV).

JSON and JSONL Import

The tool auto-detects structured JSON input:

  • JSON array: Input starting with [ must be an array of objects. Keys become column headers; key order follows first-seen order across rows.
  • JSONL: Two or more non-empty lines each starting with { are parsed as JSON Lines. Each line must be a JSON object.

JSONL example:

{"name":"Alice","age":"30"}
{"name":"Bob","age":"25"}

After import, switch Output format to CSV or Markdown to convert formats without a separate tool.

CSV/TSV import options (Skip `#`, Skip empty key, Header rows N) do not apply to JSON or JSONL.

RFC 4180 Parsing Notes

  • Fields containing commas, quotes, or newlines must be wrapped in double quotes.
  • A double quote inside a quoted field is escaped as two double quotes ("").
  • Example — quoted comma: "apple, organic",3 parses as two fields.
  • Carriage return + line feed ( ) and bare line endings are both accepted.

Frequently Asked Questions

Is my CSV data uploaded to a server?

No. Parsing, grid rendering, and export run entirely in your browser via WebAssembly. Nothing is sent to CompuTools servers.

Why do Korean or Chinese characters look wrong?

The file is likely saved in a legacy encoding (EUC-KR, GBK, etc.). This tool supports UTF-8 and UTF-16 only. Open the file in Excel or Google Sheets and re-export as CSV UTF-8 (or UTF-16 if you prefer).

How is Header row Auto-detect different from Header rows (N)?

Header row Auto/Has/No applies when Header rows (N) is Off — it decides whether a single first row is column names. Header rows (N) at 2 or more always consumes the first N rows as a merged multi-level header, ignoring the Header row setting.

Can I convert TSV to JSON?

Yes. Paste tab-separated data or upload a .tsv file. Set Delimiter to Tab (TSV) or leave Auto (tabs are detected). Choose JSON as Output format.

What happens if my file has more than 50,000 rows?

The first 50,000 data rows are loaded and a truncation notice appears. For very large datasets, split the file or use a command-line tool such as csvkit or mlr.

Does dedupe keep the first or last occurrence?

The first occurrence of each unique row is kept; later duplicates are removed. Order of remaining rows is preserved unless a sort is active.

Are all settings remembered?

Yes. Delimiter, header mode, encoding, output format, SQL table name, dedupe, input mode, and CSV import options are saved to browser localStorage and restored on the next visit.

Manual Test Cases

Use these scenarios to verify the tool end-to-end. Full step-by-step expected outputs are documented in docs/csv-test-cases.md in the project repository.

TC-1 — Basic comma CSV

name,age,city
Alice,30,NYC
Bob,25,LA

Expected: Preview 2×3; JSON export with two objects; Auto header detects name, age, city.

TC-2 — Quoted field with embedded comma

item,qty
"apple, organic",3
banana,5

Expected: apple, organic stays in one cell; not split at the comma inside quotes.

TC-3 — Google Analytics export (multi-row header)

Upload a GA revenue CSV with # comment lines, two header rows, and total rows.

  • Skip `#` lines: ON
  • Header rows (N): 2
  • Skip empty key: ON

Expected: Merged headers like United States / Revenue; metadata and blank-key total rows removed; page paths in first column.

TC-4 — JSON array import → CSV export

[{"id":1,"label":"alpha"},{"id":2,"label":"beta"}]

Expected: Grid with columns id, label; switch Output to CSV to round-trip.

TC-5 — Search, sort, dedupe

Paste a CSV with duplicate rows. Enable Dedupe → count drops. Type in Search rows → grid filters. Click column header → sort toggles Asc / Desc / None.

TC-6 — FILE mode UTF-16 Excel export

Save a spreadsheet as CSV UTF-16 in Excel. Upload in FILE mode with encoding UTF-16 LE. Expected: characters intact, grid populated.

TC-7 — Error handling

  • Empty input → no grid; placeholder in Result.
  • Unclosed quote → parse error message.
  • File > 5 MB → size limit error.
  • EUC-KR file → encoding error with re-save guidance.

Related Tools

  • Markdown Editor — Live Markdown preview with GitHub Flavored Markdown: tables, task lists, footnotes, math-friendly layout, table of contents, and HTML export. Ideal for README and docs—runs in your browser.
  • Text Case Converter — Convert naming conventions for code and docs: camelCase, PascalCase, snake_case, kebab-case, flat case, alternating case, sentence/title case, and more. Batch-friendly, copy results locally.
  • Universal Text Codec — Encode or decode text in 20+ formats simultaneously: Base16, Base32, Base36, Base45 (RFC 9285), Base58 (Bitcoin/IPFS), Base62, Base64, Base64url, Base85 (Ascii85 & z85), Base91, URL percent-encoding, HTML entities, Unicode escapes (JS/Python), ROT13, Punycode, and more. Auto-detects encoding. All processing runs locally in your browser.
  • Base64 Encoder/Decoder — Encode and decode Base64 data with support for files and URLs
  • Base32 Encoder/Decoder — Encode and decode Base32 data for TOTP, 2FA secrets, and human-readable encoding

Parse & display

CSV / TSV import options (not applied to JSON or JSONL):

Export

Input settings

Input
TEXT Mode
Supports RFC 4180 CSV/TSV, JSON arrays of objects, and JSONL. File upload: UTF-8 (BOM ok) or UTF-16 LE/BE — not legacy locale encodings.
Result (JSON)
Click to copy
Need JSON tree/table views or YAML? Try the JSON Formatter and Format Converter. Generate fake rows from a schema in Mock Data Generator.