ForHosting KIT · Data & Files

Detect CSV delimiter

CSV files do not always use commas. Regional exports often use semicolons, data pipelines may choose tabs, and command-line tools frequently produce pipe-separated text.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

This detector examines a representative sample and identifies the most likely delimiter among comma, semicolon, tab, and pipe. It requires a stable pattern across non-empty lines, so it does not silently guess when the structure is inconsistent. The result includes the delimiter, its readable name, the inferred number of columns, and the number of lines examined.

Choose a representative CSV sample

Paste at least two non-empty lines from the same CSV file, ideally including the header and several ordinary data rows. A useful sample preserves the original separators and line breaks; there is no need to upload an entire large file merely to identify its format. The detector considers four common candidates: comma, semicolon, tab, and pipe. It ignores blank lines, including a final empty line left by many text editors, because those lines contain no field structure. Every meaningful line should contain the same number of occurrences of the real separator. For example, a header with three fields and two data rows with three fields produces two separator occurrences on each line. Samples containing explanatory text before the header, multiline records, or truncated rows should be cleaned or replaced with a more representative section first. Consistent input gives the tool evidence about structure instead of asking it to infer a delimiter from a single isolated character. The input stays unchanged: detection reports its finding but never reformats, parses, stores, or corrects the supplied CSV text.

Understand the frequency decision

For each candidate character, the detector counts literal occurrences on every non-empty line. A candidate remains eligible only if it appears at least once on every line and its count is identical across those lines. Among eligible candidates, the one with the greatest per-line frequency is selected. This approach is deterministic and easy to audit: the same text always produces the same result, with no model, network request, locale setting, or random choice involved. The returned column count is one greater than the winning occurrence count, while the line count shows how much evidence was examined. Frequency analysis is intentionally narrower than a complete CSV parser. In particular, candidate characters inside quoted values still count as literal occurrences. If quoted prose contains varying commas while semicolons consistently separate fields, the semicolon may still qualify correctly, but complex quoted or multiline records can make every candidate inconsistent. In that situation the detector returns an error rather than presenting an unreliable guess. Use a dedicated CSV parser after detection when you need full quote and escape handling.

Handle inconsistent and ambiguous samples

An error is useful when the sample does not support a defensible answer. If no comma, semicolon, tab, or pipe has the same positive count on every non-empty line, the tool reports that no candidate appears consistently. This commonly reveals damaged rows, mixed exports, pasted notes, or a sample that is not delimited data at all. A second error covers ambiguity: two or more candidates may appear with the same highest consistent frequency. Choosing one by arbitrary priority would make downstream parsing unpredictable, so the detector asks for a clearer sample instead. Add more representative rows, remove surrounding commentary, or inspect the source system's export settings. A one-line value is also rejected because repeated structure across lines is the core evidence used by this method. Once detection succeeds, pass the returned delimiter character into your CSV reader and optionally verify that parsed rows have the reported column count. Browser use is available without server processing, while automated API calls cost $0.002 per request. In both channels, identical pure logic produces the same result.

Configure an import automatically

Inspect a supplier sample before selecting the delimiter option for a CSV parser or database import.

Diagnose a broken spreadsheet upload

Confirm whether an export uses a regional semicolon format instead of the comma expected by an upload form.

Validate pipeline assumptions

Check that incoming delimited text has stable row structure before a transformation or schema-mapping step begins.

Which delimiters can be detected?

The candidates are comma, semicolon, tab, and pipe.

What makes a delimiter consistent?

It must appear at least once and have exactly the same occurrence count on every non-empty line.

Are blank lines included?

No. Blank and whitespace-only lines are ignored, including a trailing empty line.

Does detection understand quoted CSV fields?

No. It performs literal frequency analysis, so candidate characters inside quoted values are counted.

Why does an ambiguous sample return an error?

When multiple candidates tie for the strongest consistent frequency, selecting one by priority would be an unsupported guess.

How much does the API request cost?

Each API request costs $0.002; the browser version runs locally for free.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/data/detect-csv-delimiter

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/data/detect-csv-delimiter \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"name,city,score\nAda,London,92\nLinus,Helsinki,88"}'
{
  "text": "name,city,score\nAda,London,92\nLinus,Helsinki,88"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "data.detect_csv_delimiter",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_mb25
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →