Delimiter Sniffer (Comma/Semicolon/Tab)

Compare comma, semicolon, and tab dialects by the fraction of records having their modal field count; ties and one-column samples remain ambiguous.

Description

Delimiter detection compares possible dialects rather than assuming the most frequent raw character is a separator.

Delimiter detection compares possible dialects rather than assuming the most frequent raw character is a separator. Quotes and inconsistent rows can make the result ambiguous.1

Compare comma, semicolon, and tab dialects by the fraction of records having their modal field count; ties and one-column samples remain ambiguous.

When to use Delimiter Sniffer (Comma/Semicolon/Tab)

Use this for the following task: Compare comma, semicolon, and tab dialects by the fraction of records having their modal field count; ties and one-column samples remain ambiguous.

Prepare the CSV text, decoded cells or byte values requested below. Choose delimiter and header flags explicitly when those fields are present.

How to use Delimiter Sniffer (Comma/Semicolon/Tab) and understand its results

  1. Prepare the CSV text, decoded cells or byte values requested below. Choose delimiter and header flags explicitly when those fields are present.
  2. Enter csv using the field table, then run the tool.
  3. Read delimiter, ambiguous, candidates. Interpret flags, units, ordering and placeholder values using the rules below.
  4. Review any reported issue or failed check, correct the supplied values when appropriate, and verify the result in its intended context.
Input fieldMeaningValue type and boundsRequirement
csvCSV textstring; maximum text length 100000Required

Parse comma, semicolon and tab candidates separately. Omit invalid dialects and one-column modes, select each mode by frequency with wider-width tie preference, then compare consistency fractions. Report an empty delimiter for no candidate or a top-score tie.2

Parse delimiters only outside quoted fields and decode doubled quotes. A quoted line break stays inside its cell; malformed quoting is returned as an input error.

score = records matching modal field width/recordCount

This summarizes the declared operation. Units, indexing, inclusivity and exceptional cases are explained in the surrounding text.

Output fieldMeaningValue type
delimiterDelimiterstring
ambiguousAmbiguousboolean
candidatesCandidateslist of record: delimiter (string), modalWidth (integer), matchingRecords (integer), recordCount (integer)
json
{
  "input": {
    "csv": "name;age\nAda;36"
  },
  "output": {
    "delimiter": ";",
    "ambiguous": false,
    "candidates": [
      {
        "delimiter": ";",
        "modalWidth": 2,
        "matchingRecords": 2,
        "recordCount": 2
      }
    ]
  }
}

Limitations and assumptions

This heuristic does not guarantee the intended dialect. Resource-limit errors are returned rather than hidden; candidate details support manual review.

Where CSV is parsed, the shared parser accepts comma, semicolon or tab separators, doubled quotes and quoted line breaks, with CR/LF/CRLF record endings. Blank records remain records. CSV inputs are bounded to 100000 UTF-16 units and 10000 fields. Malformed requests produce input errors. A successfully evaluated request can still contain false flags, empty result lists or a result outside the supplied threshold; those outcomes have the meanings stated above.

Alternative or Complementary methods

Choose Header Row Detection Heuristic for this operation: Flag a possible header when its labels are unique and nonempty and at least half of columns have text labels above consistently numeric values; this is an explicit heuristic. For a complementary task, use Quoted Multiline Safe Splitter for this operation: Split CSV into raw record fragments without outer record endings, preserving quote spelling, embedded line endings, blank records, and escaped quote pairs.

Further background: Format and language reference: Delimiter Sniffer (Comma/Semicolon/Tab).

References

  1. Format and language reference: Delimiter Sniffer (Comma/Semicolon/Tab) — RFC Editor

  2. Delimiter Sniffer (Comma/Semicolon/Tab) — tool.io

Similar or alternative tools

  • Header Row Detection Heuristic

    Flag a possible header when its labels are unique and nonempty and at least half of columns have text labels above consistently numeric values; this is an explicit heuristic.

  • Quoted Multiline Safe Splitter

    Split CSV into raw record fragments without outer record endings, preserving quote spelling, embedded line endings, blank records, and escaped quote pairs.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies