Comma-Separated Values (CSV) Converter
Convert CSV-like text into structured formats, review row alignment and column completeness, and keep sensitive source data in your browser.| # | {{ header }} | Copy |
|---|---|---|
| {{ row.number }} | {{ cell === '' ? '—' : cell }} | |
No parsed rows Correct the source text or parsing controls to populate this table. |
| Column | Dominant type | Populated | Empty | Unique | Copy |
|---|---|---|---|---|---|
| {{ row.label }} | {{ row.type }} | {{ row.populated }} | {{ row.empty }} | {{ row.unique }} |
{{ values.converted_text || '' }}
{{ exportAnnouncement }}
Delimited text looks simple until a field contains its own comma, quote, or line break. A reliable conversion must decide where records end, which character separates fields, whether the first row contains names, and how missing or uneven cells should be represented. A visually tidy preview can still be structurally wrong if any of those assumptions are wrong.
CSV is a common exchange convention rather than one perfectly uniform dialect. Spreadsheet exports may use commas, tabs, semicolons, or pipes. Quotes can protect delimiters inside a value, and applications disagree about header rows, blank records, escaping, and type inference. The safest handoff keeps these choices explicit and checks row alignment before converting.
- Delimiter
- The token between fields. It may contain one to four characters here, except line breaks.
- Quote character
- A boundary that lets a field contain delimiters or newlines without splitting.
- Header row
- Optional field names used as record keys, table headings, XML names, or SQL columns.
- Row shape
- The number and order of fields in each record. Uneven rows need review because padding cannot recover missing meaning.
Type detection is another tradeoff. Turning true into a Boolean and 98.5 into a number helps structured output, but identifiers such as postal codes and account references should often remain text. Leading-zero integers are deliberately left as text. Dates are recognized only when type detection and ISO-date normalization are both enabled.
Conversion changes syntax, not trust. Generated HTML and XML escape markup characters, and SQL string values escape apostrophes, but the output is not checked against a destination schema or executed safely on your behalf. Spreadsheet programs may interpret cells beginning with formula characters as commands, so untrusted data needs a destination-specific formula-injection review.
How to Use This Tool:
Treat parsing as a review step before choosing the destination syntax.
- Paste, drop, or select one text file no larger than 2 MiB. The conversion accepts up to 500 data rows and 40 columns.
- Choose the Source delimiter, quote character, and quote-escaping rule. Auto detection tests comma, tab, semicolon, and pipe; pin the delimiter when the source contract is known.
- Set Header row to present or absent when the first row is ambiguous. Use column-name overrides only when the destination needs different safe identifiers.
- Enable trimming, blank-row removal, type detection, date recognition, or null conversion only when those changes match the downstream schema.
- Select the output format, then review the parsed rows, irregular-row warnings, column types, and empty-cell counts before copying or downloading the converted text.
Interpreting Results:
The parsed table is the main correctness check. Confirm that quoted delimiters stayed inside their fields, every column shifted into the intended position, and the detected header is genuinely a header. An Irregular row count greater than zero means shorter records were padded with empty cells to match the widest row; the converter cannot know whether the missing value belongs at the end or elsewhere.
- Compare Requested delimiter with Resolved delimiter whenever auto detection was used.
- Review column types before using JSON or SQL output. A dominant type summarizes the column; it does not prove every cell follows that type.
- The completeness chart shows at most the 12 columns with the most empty cells. The column profile retains all columns.
- Open generated output in a safe review context. Do not execute SQL or allow untrusted spreadsheet formulas merely because parsing succeeded.
Technical Details:
Delimited parsing is a stateful scan. A delimiter or line break ends a field only while the parser is outside a quoted field. Repeated quote characters or backslash escapes can represent a literal quote according to the selected policy. Newlines are normalized before scanning, but spaces remain data unless trimming is enabled.
Transformation Core:
| Stage | Governing behavior |
|---|---|
| Resolve dialect | Use the pinned delimiter or score comma, tab, semicolon, and pipe from the first 20 parsed rows. Ties keep that candidate order, so comma wins an equal score. |
| Parse records | Honor the selected quote and escape policy, optionally trim field edges, optionally skip rows whose cells are all blank, and reject an unclosed quoted field. |
| Set shape | The widest row defines column count. Shorter rows are padded on the right, then the selected or detected header policy separates field names from data. |
| Normalize names | Unsupported characters become underscores, leading digits gain a column_ prefix, blank names receive numbered fallbacks, and duplicates receive numeric suffixes. |
| Convert values | Optional detection recognizes Booleans, null-like words, finite numbers without ambiguous leading zeroes, and valid ISO-style dates when date recognition is enabled. |
| Serialize | Rows are emitted as delimited text, JSON records or arrays, JSON Lines, Markdown, HTML, XML, or SQL INSERT syntax using format-specific escaping. |
Rule Core:
Auto header detection is intentionally conservative. It requires at least two rows, a nonempty first row, unique case-insensitive labels, and label-like first-row text. It then needs either a familiar heading such as id, name, or date, or a type contrast in which later sample cells look numeric, Boolean, or date-like while the first row does not.
| Condition | Result |
|---|---|
| Empty source or no detectable separator | Conversion stops; add records or pin the delimiter. |
| Unclosed quoted field | Conversion stops; correct the quote or escape setting. |
| More than 500 data rows | Conversion stops. A detected header is not counted as a data row. |
| More than 40 columns | Conversion stops. |
| Preview limit | 0 shows all rows; otherwise use a whole number from 10 through 500. |
| Custom delimiter | One to four characters with no carriage return or line feed. |
CSV and TSV output use double quotes when a field contains the destination delimiter, a quote, or a line break, and embedded double quotes are doubled. Blank records inside the source remain unless skipping is enabled, while trailing empty lines are discarded. HTML and XML escape markup-sensitive characters. SQL output quotes identifiers and string literals, but it neither creates a schema nor provides a safe execution boundary. JSON Lines writes one JSON object per line.
Privacy and Safety Notes:
Source text is processed in the browser, excluded from shareable settings, and not persisted by the converter. Reloading replaces it.
- Do not paste secrets unless the device, browser profile, clipboard, and surrounding environment are trusted.
- Generated HTML, XML, and SQL are inert text here. Review them before insertion into a page, parser, or database.
- Formula-like spreadsheet cells are not neutralized. Apply the receiving spreadsheet application's current defensive policy before opening untrusted output.
Worked Examples:
Semicolon export with decimal commas
A regional spreadsheet export may use semicolons between fields so values such as 12,50 remain intact. Pin Semicolon instead of trusting a mixed sample. Confirm the parsed table has the expected columns before producing JSON or standard comma-delimited output.
Identifiers kept as text
With type detection enabled, 001 remains text because converting it to the number 1 would discard meaningful zeroes. Values such as true and 5 can still become Boolean and numeric values in JSON, while an empty cell becomes null only when that option is enabled.
References:
- RFC 4180: Common Format and MIME Type for CSV Files, RFC Editor, October 2005.
- CSV Injection, OWASP Foundation.