CSV Formatter

Runs 100% in your browser

Format CSV and TSV locally with quote-aware parsing, delimiter conversion, 4 quoting modes, CRLF/LF control, row-shape diagnostics, table preview, and clean download — no upload.

CSV Input

Paste CSV or open a file

Formatted CSV

No output yet
0Rows
0Columns
0Fields
0Quoted
0Bytes out
0%Size ?
0Warnings

Formatting Review

Waiting
Load CSV to see quoting, row-shape, delimiter, and formatting diagnostics.
Table Preview First rows of formatted output rendered as HTML

A formatted table preview will appear here.

Session-only format history Cleared when tab closes

No format runs yet.

Privacy: CSV parsing and formatting run entirely in page memory. This tool does not upload, persist, execute, or share the contents of your file. "Never quote" mode may produce invalid CSV when cells contain delimiters, quotes, or line breaks — review the output before use. Press Ctrl+Enter to format at any time.

Frequently asked questions

A CSV Formatter reads comma-separated or delimiter-separated values and writes them back in a consistent, canonical form. It normalizes quoting, delimiter choice, line endings, and outer whitespace without changing data values. ToolsSonic's CSV Formatter runs entirely in your browser — no file is ever uploaded to a server.

A CSV Viewer displays data as a sortable, searchable table for inspection. A CSV-to-JSON converter changes the file format entirely. A CSV Formatter keeps the CSV format but normalizes its text representation — fixing quoting, delimiters, line endings, and whitespace so the output is clean and consistent for downstream systems.

The parser uses a character-level state machine. When it encounters an opening double-quote at the start of a field, it enters a quoted state where commas are treated as literal characters rather than delimiters. The quoted state ends only at a closing double-quote that is not immediately followed by another double-quote (which would be an escaped quote character).

Minimal quoting adds double-quotes only when a field actually needs them — when it contains the delimiter character, a double-quote, or a newline. Fields that contain none of these characters are written without quotes. This is the RFC 4180 default and produces the most compact output.

Quote all fields wraps every cell value in double-quotes regardless of content. This is useful when the receiving system requires strict quoting, when you want guaranteed consistent parsing regardless of field content, or when preparing data for systems like Excel that can misinterpret unquoted numeric-looking values as numbers.

Quote non-numeric mode adds double-quotes around every field whose value cannot be parsed as a plain integer or decimal number. Numeric values are left unquoted. This is the Python csv.QUOTE_NONNUMERIC behavior and is useful for interoperability with systems that distinguish typed CSV columns.

Never quote mode writes every field without double-quotes, even if the value contains a delimiter, a quote character, or a newline. This will produce invalid CSV whenever such characters appear. The tool shows a warning when it detects this situation. This mode is provided only for review and analysis — never for production output.

The formatter scans the first 15 lines of your input and counts occurrences of five candidate characters — comma, tab, semicolon, pipe, and colon — while tracking quoted fields to avoid counting delimiters inside quoted values. The character with the highest unquoted count is selected as the detected delimiter. A detected delimiter of TAB means the file is being read as TSV.

Set Input delimiter to Auto-detect (or Comma if you know the source) and set Output delimiter to Tab (TSV). Click Format CSV. The output will use actual tab characters as field separators and your chosen line ending. You can then copy or download the result as a .csv file that any TSV reader will parse correctly.

CRLF (\r\n) is the line ending defined by RFC 4180 and is required by Microsoft Excel and many Windows-based CSV importers. LF (\n) is the Unix convention used by Linux, macOS, and most developer tools. If a downstream system produces parsing errors or extra blank rows, switching between CRLF and LF often resolves the issue.

When enabled, the formatter removes leading and trailing spaces and tabs from each cell value before quoting and writing the output. Embedded whitespace inside the value is preserved. This is useful for cleaning exported CSVs where spreadsheet tools added extra spaces around values.

By default the formatter drops rows that contain only empty fields. Enabling Keep blank rows preserves those rows in the output. This is useful when blank lines are meaningful separators in your data structure, such as groupings or section breaks.

This setting only affects the table preview — it causes the first row to be rendered as the table header row with column labels rather than as a data row. It does not change the formatted CSV output. The header row is always preserved in the output exactly like any other row.

A row shape warning appears when one or more rows have a different number of fields than the maximum field count in the file. For example, if most rows have 4 fields but one row has 3, the formatter warns "Row at line N has 3 fields; expected 4." This indicates malformed input that may cause parsing errors in downstream tools.

An unclosed quoted field warning means the parser encountered an opening double-quote at the start of a field but never found the corresponding closing double-quote before reaching the end of the input. This is a common sign of a CSV file where a value contains a literal double-quote that was not properly escaped as two consecutive double-quotes ("").

No. All parsing, formatting, and preview rendering run entirely in your browser using JavaScript. The tool does not use fetch(), XMLHttpRequest, sendBeacon, localStorage, or sessionStorage. Your CSV content never leaves your device. This makes it safe for confidential data, internal exports, and personal information.

Size Δ shows the percentage change in byte size between the original input and the formatted output. A positive value means the output is larger than the input — usually because quote-all mode adds quotes around every field. A negative value means the output is smaller — usually because trim mode removed padding or minimal quoting removed unnecessary quotes.

Yes. Set Input delimiter to Auto-detect or Tab (TSV). The parser will correctly handle tab-separated values including quoted fields that contain commas. You can then output the result as comma-delimited CSV, semicolon-delimited, pipe-delimited, or keep it as TSV by setting Output delimiter to Tab.

CSVLint is a validation service that checks CSV structure against schemas — it runs on a server and is focused on validation rather than reformatting. csvkit is a command-line toolkit that requires Python installation. ToolsSonic's CSV Formatter offers similar quoting and delimiter controls in a browser UI with no installation, no upload, and dark mode — making it accessible to developers and non-developers alike.

No. The formatter treats all cell values as plain text. It does not infer types, rewrite dates, format numbers, evaluate formulas, or perform data cleaning beyond optional whitespace trimming. Values appear in the output exactly as they appear in the input, modulo quoting normalization and whitespace trimming if enabled.

What is CSV Formatter?

What Is a CSV Formatter and Why Do You Need One?

A CSV Formatter reads raw comma-separated or delimiter-separated text and writes it back in a clean, normalized form — without changing the underlying data values. It handles the messy reality of real-world CSV files: inconsistent quoting, mixed line endings, extra whitespace, tab-delimited exports masquerading as CSV, semicolon-delimited European files, and pipe-separated log formats.

When you receive a CSV from a client, an API, a database export, or a legacy system, it may have been created by a dozen different tools — each with its own quoting conventions, line-ending preferences, and ideas about when to add double-quotes. Before the file goes into a database importer, a Python script, a BI tool, or an ETL pipeline, a formatter applies a single consistent ruleset. The result is a canonical CSV that any downstream parser can read without guessing.

ToolsSonic's CSV Formatter parses your input with a full RFC-style character-level scanner that correctly handles every tricky case: embedded commas inside double-quoted fields, embedded newlines inside quoted values, escaped double-quotes written as two consecutive double-quotes (RFC 4180 §2), tabs vs commas vs semicolons as separators, and inconsistent column counts across rows. The output is a normalized file with your chosen delimiter, line ending, and quoting policy — ready to copy, download, or paste directly into the next step of your workflow.

The Four Quoting Modes Explained

Most online CSV tools have one behavior for quoting: they either quote everything or nothing. ToolsSonic gives you four precise modes that match the behaviors of Python's csv module, RFC 4180, and csvkit:

Minimal quoting adds double-quotes only when a field contains the delimiter, a double-quote, or an embedded newline. Every other field is written without quotes. This is the RFC 4180 default — compact, widely supported, and correct for interchange.

Quote all fields wraps every value in double-quotes regardless of content. Use this when your target system requires strict quoting, or when you need to prevent numeric-looking strings from being misinterpreted as numbers by Excel or Google Sheets.

Quote non-numeric skips quotes on fields whose value parses as a plain integer or decimal, and quotes everything else. This matches Python's csv.QUOTE_NONNUMERIC behavior and is useful for type-aware CSV consumers that distinguish columns by their quoting.

Never quote (review) writes every field bare, no matter what it contains. This mode deliberately produces invalid output whenever a field contains a delimiter, quote, or newline — which is why the tool shows a warning. It exists for diagnostic review only.

Delimiter Conversion, Diagnostics, and Privacy

CSV-to-TSV and beyond: Set Input delimiter to Auto-detect and Output delimiter to Tab to convert any comma CSV to a proper TSV file. You can also convert to semicolon (the European standard used by many regional Excel locales), pipe (log files and fixed-schema data), or colon. The formatter auto-detects your input delimiter by scanning the first 15 lines — no guessing required.

Row-shape diagnostics: When rows have different numbers of fields, the formatter reports exactly which line is off and how many fields it found versus how many were expected. When an opening double-quote is never closed, the formatter reports the line number where the unclosed field began. These diagnostics catch the most common causes of silent parsing failures.

Browser-only privacy: No fetch(), no XMLHttpRequest, no sendBeacon, no localStorage, no sessionStorage. CSV parsing and formatting happen entirely in JavaScript inside your tab. Closing the tab clears every byte of your data. This makes ToolsSonic's CSV Formatter the correct choice for internal data, customer exports, financial records, and confidential spreadsheets — none of which should transit a public conversion server.

Common use cases

  • Normalizing a CSV export from a legacy ERP or CRM before importing into a modern database
  • Converting a semicolon-delimited European CSV to a comma CSV for North American tools
  • Converting a comma CSV to TSV for a Python or R script that expects tab-separated input
  • Cleaning up extra whitespace and inconsistent quoting before running a data pipeline
  • Diagnosing malformed CSV — unclosed quotes and inconsistent column counts — before import
  • Preparing a CSV with quoted-all fields for Excel, which misreads leading zeros as numbers when unquoted
  • Normalizing CRLF line endings for Windows tools or LF endings for Unix pipelines and macOS
  • Previewing CSV data as a formatted HTML table before committing to an import

Why use ToolsSonic's CSV Formatter?

Most online CSV tools fall into one of four categories: validators that only check errors against CSVW schemas and RFC 4180 rules (CSVLint, csvlint.io), CLI tools that require Python installation (csvkit, csvformat), table viewers that show data but don't reformat it (Code Beautify CSV Viewer), or conversion tools that change the format entirely (ConvertCSV, TableConvert).

ToolsSonic's CSV Formatter is the only browser-based tool that combines RFC-style quote-aware parsing, four quoting modes, delimiter conversion, CRLF/LF control, whitespace policies, row-shape and unclosed-quote diagnostics, a live HTML table preview, and full dark mode — without uploading your file to any server. Where CSVLint sends your data to a server for validation, and csvkit requires you to install Python and learn command-line flags, ToolsSonic works immediately in any browser with no setup.

The 7-stat panel (rows, columns, fields, quoted fields, output bytes, size change percentage, and warning count) gives you an instant health check of your CSV. Session history stores the last 8 format runs for quick comparison. Ctrl+Enter triggers formatting from anywhere on the page. These workflow features don't exist in any competing browser CSV tool.

CSV Quote Mode Reference

| Mode | Adds quotes when | Python equivalent | RFC 4180 | |---|---|---|---| | Minimal | Field contains delimiter, ", or newline | csv.QUOTE_MINIMAL | Default | | Quote all | Always | csv.QUOTE_ALL | Compliant | | Quote non-numeric | Field is not a plain number | csv.QUOTE_NONNUMERIC | Compliant | | Never quote (review) | Never — diagnostic mode only | csv.QUOTE_NONE | Invalid if fields contain special chars |

CRLF vs LF: - CRLF (\r\n): RFC 4180 required, Excel/Windows standard - LF (\n): Unix/macOS/Linux standard, required by many pipelines

Delimiter detection scoring: The auto-detector counts unquoted occurrences of each candidate delimiter across the first 15 lines. The delimiter with the highest count wins. Tie-breaker order: comma → tab → semicolon → pipe → colon.

ToolsSonic CSV Formatter vs Competitors

| Feature | ToolsSonic | CSVLint | csvkit | Code Beautify | ConvertCSV | |---|---|---|---|---|---| | Browser-only, no upload | ✅ | ❌ Server | ❌ CLI | ⚠️ Partial | ❌ Server | | RFC quote-aware parser | ✅ | ✅ | ✅ | ❌ | ✅ | | Embedded newlines in cells | ✅ | ✅ | ✅ | ❌ | ✅ | | Delimiter auto-detection | ✅ 5 types | ✅ | ✅ | ❌ | ✅ | | Output delimiter conversion | ✅ 4 options | ❌ | ✅ CLI only | ❌ | ✅ | | 4 quote modes | ✅ | ⚠️ Partial | ✅ CLI only | ❌ | ⚠️ Partial | | Row-shape diagnostics | ✅ | ✅ | ✅ | ❌ | ✅ | | Unclosed quote detection | ✅ | ✅ | ✅ | ❌ | ❌ | | HTML table preview | ✅ | ❌ | ❌ | ✅ Grid | ✅ Grid | | Dark mode | ✅ | ❌ | ❌ | ❌ | ❌ | | Session history | ✅ 8 entries | ❌ | ❌ | ❌ | ❌ | | No installation needed | ✅ | ✅ | ❌ Python | ✅ | ✅ |

100% private — runs in your browser Instant — no server round-trip Free forever — no account needed

CSV Viewer

Editor's choice

View CSV and TSV files as a fast, searchable, sortable table. Detect delimiters, inspect columns, filter rows, sort mixed data, toggle columns, paginate large previews, and export selected rows locally.

CSV to JSON Converter

Editor's choice

Convert CSV to clean JSON locally. Parse quoted fields, commas, tabs, semicolons, duplicate headers, numbers, booleans, nulls, nested dot keys, keyed objects, column arrays, or JSON Lines, then copy or download the result.

JSON to CSV Converter

Editor's choice

Convert JSON arrays, nested objects, and array properties into clean CSV locally. Flatten dot keys, expand arrays to indexed columns, choose delimiters and quotes, preview rows, and download spreadsheet-ready output without uploading data.

TSV to CSV Converter

Editor's choice

Convert tab-separated values to CSV online for free in your browser. Preserve quoted tabs, commas, newlines, and escaped quotes; choose delimiters, headers, line endings, and quoting modes; preview, copy, or download privately.

CSV to SQL INSERT

Editor's choice

Convert CSV to SQL INSERT statements with dialect hints, identifier quoting, NULL and type policies, batching, and row diagnostics — nothing uploaded.

Markdown Table Generator

Editor's choice

Create aligned GitHub Flavored Markdown pipe-table syntax visually — edit rows and columns, paste from Excel, Google Sheets, CSV, or an existing Markdown table, set per-column alignment, escape pipes, preview the rendered result, and download .md, .html, or .csv. Free, no upload.