Overview
Introduction
CSV exports don't always use commas. Excel's regional settings, European database exports, and log files pasted from a terminal frequently use semicolons, tabs, or pipes instead, and pasting that into a comma-only CSV tool silently produces one giant unparsed column.
This tool figures out which delimiter a pasted block of text is actually using and rewrites it as standard, comma-delimited CSV so downstream tools that expect commas work correctly.
What Is CSV Delimiter Detector and Normalizer?
A delimiter detector and normalizer for CSV-like text: it inspects a pasted block of rows, works out which of comma, semicolon, tab, or pipe is being used as the column separator, and outputs the same data re-written with commas.
It runs entirely client-side as part of this site's String Tools collection, so nothing you paste is ever uploaded to a server.
How CSV Delimiter Detector and Normalizer Works
For each candidate delimiter, the tool counts how many times it appears on every line while ignoring anything inside double-quoted fields (so a comma inside a quoted address doesn't get miscounted as a column separator). The delimiter whose count matches most consistently across all lines, and is non-zero, is reported as detected.
The detected delimiter is then used to parse the text into rows with this repo's shared delimited-text parser (which honors RFC 4180 quoting, including quoted fields that span multiple lines), and the rows are re-serialized as comma-delimited CSV, re-quoting any field that itself contains a comma, quote, or newline.
When To Use CSV Delimiter Detector and Normalizer
Use it right after pasting an export from a tool or region that doesn't default to commas, a European Excel export using semicolons, a database dump using pipes, or a log file using tabs, before feeding the data into a comma-only CSV parser.
It's a fast way to get consistent, comma-delimited CSV without opening a spreadsheet application or writing a one-off script just to check.
Often used alongside CSV to JSON Converter, CSV Joiner & Column Splicer and CSV to TOON.
Features
Advantages
- Detects the delimiter automatically instead of requiring you to specify it up front.
- Ignores delimiter characters that appear inside quoted fields, so it doesn't get confused by a comma inside an address or a quoted number.
- Re-quotes fields correctly on output, so values containing commas, quotes, or newlines survive the round trip to comma-delimited CSV.
Limitations
- Detection is heuristic, based on consistency of counts across lines, and can be wrong on very short (one or two row) or highly irregular inputs.
- Only comma, semicolon, tab, and pipe are considered; any other single-character delimiter won't be detected.
Examples
Best Practices & Notes
Best Practices
- Check the reported delimiter before trusting the normalized output on unusual or very short inputs, where the heuristic has less data to work with.
- Run the CSV Encoding Detector first if the source file might not be UTF-8, since delimiter detection works on already-decoded text.
- Feed the normalized comma-delimited output straight into Convert CSV to JSON or the CSV Joiner & Column Splicer, both of which expect commas.
Developer Notes
Delimiter counting scans each line character by character, toggling an `inQuotes` flag on unescaped double quotes so delimiters inside quoted fields are never counted; consistency is scored as the fraction of lines whose count matches the first line's count for that candidate, and the highest-scoring, non-zero candidate wins. Parsing and re-serialization reuse this repo's shared `parseDelimited`/`serializeCsv` helpers rather than a second hand-rolled parser.
CSV Delimiter Detector and Normalizer Use Cases
- Normalizing a semicolon-delimited export from a European locale Excel before importing it elsewhere
- Converting a tab-separated log or database dump into standard CSV
- Cleaning up pipe-delimited data pasted from a legacy system before running it through a comma-only tool
Common Mistakes
- Assuming pasted data is comma-delimited just because it's called a "CSV" file; many real-world exports use semicolons or tabs instead.
- Not noticing that a comma inside a quoted field was being miscounted as a delimiter by a naive detector; this tool specifically guards against that by ignoring delimiters inside quotes.
Tips
- If detection fails, check whether the pasted text actually has consistent columns at all; ragged rows with a varying number of fields will defeat the consistency heuristic.
- Paste only the data rows plus header, without extra leading or trailing blank lines, for the most reliable detection.