Guides / Delimiters

CSV Delimiters Explained: Commas, Tabs, and More

Understanding the different separators used in CSV files and when to use each one.

By text2csv.com team · ·

While "CSV" stands for Comma-Separated Values, not all CSV files use commas as their delimiter. Understanding different delimiter options is crucial for working with data from various sources and regions.

What is a Delimiter?

A delimiter is a character that separates individual values (fields) within a row of data. In a CSV file, the delimiter tells software where one field ends and another begins.

Name,Email,Age    ← Comma delimiter
Name	Email	Age    ← Tab delimiter
Name;Email;Age    ← Semicolon delimiter

Common Delimiters

Comma (,)

The most common delimiter, especially in English-speaking countries.

John,john@example.com,28,New York

Use when: Default choice for most applications, especially US-based systems.

Watch out: Data containing commas must be quoted.

Tab (\t)

Creates TSV (Tab-Separated Values) files. Common when copying from spreadsheets.

John	john@example.com	28	New York

Use when: Data may contain commas, or copying from Excel/Google Sheets.

Advantage: Tabs rarely appear in actual data, reducing escaping needs.

Semicolon (;)

Standard in many European countries where comma is used as decimal separator.

Product;Price;Quantity
Widget;19,99;100

Use when: Working with European data or decimal numbers with commas.

Common in: Germany, France, Italy, Spain, Netherlands, and other EU countries.

Pipe (|)

Less common but useful when data contains both commas and semicolons.

John Smith|123 Main St, Apt 4|New York

Use when: Data contains commas, semicolons, or needs clear visual separation.

Common in: Database exports, log files, legacy systems.

Space

Used in fixed-width or simple data files.

John 28 NYC
Jane 34 LA

Use when: Simple data without spaces in values.

Warning: Problematic if field values contain spaces (e.g., "New York").

Regional Differences

The choice of delimiter often depends on regional settings, particularly the decimal separator used in that country. When a region uses comma as the decimal separator (e.g., "19,99" for 19.99), the CSV delimiter must be something else — typically semicolon. This is why Microsoft Excel on European locale installations defaults to semicolons when saving CSV files.

Country / RegionDecimal SeparatorThousands SeparatorCSV Delimiter
USA, UK, Australia, Canada (English)Period (.)Comma (,)Comma (,)
Germany, AustriaComma (,)Period (.)Semicolon (;)
France, Belgium (French)Comma (,)Space ( )Semicolon (;)
Spain, Italy, PortugalComma (,)Period (.)Semicolon (;)
Netherlands, Belgium (Dutch)Comma (,)Period (.)Semicolon (;)
Brazil, ArgentinaComma (,)Period (.)Semicolon (;)
Russia, UkraineComma (,)Space ( )Semicolon (;)
Japan, China, South KoreaPeriod (.)Comma (,)Comma (,)
IndiaPeriod (.)Comma (,)Comma (,)
SwitzerlandPeriod (.) or Comma (,)Apostrophe (')Semicolon (;) or Comma (,)
Canada (French)Comma (,)Space ( )Semicolon (;)

Why this matters: In countries using comma as decimal separator, "19,99" means 19.99 (the price). Using comma as CSV delimiter would break the data: Widget,19,99 would be parsed as three fields instead of two.

How to Detect the Delimiter

When you receive a CSV file and aren't sure which delimiter is used, there are both manual and programmatic approaches:

Manual Detection

  1. Open in a text editor: View the raw file to see which character separates values. In VS Code, Notepad++, or Sublime Text, the delimiter is immediately visible.
  2. Check the file extension: .tsv files use tabs. .csv usually means comma or semicolon depending on the origin country.
  3. Look at the header row: Count occurrences of potential delimiters. The correct one appears the same number of times on every line.
  4. Try importing: Most spreadsheet apps let you specify the delimiter when importing. Try comma first, then semicolon, then tab.

Programmatic Detection

Python's built-in csv module includes a Sniffer class that can automatically detect the delimiter:

import csv

with open('data.csv', 'r') as f:
    sample = f.read(8192)  # Read first 8KB
    dialect = csv.Sniffer().sniff(sample)
    print(f"Detected delimiter: '{dialect.delimiter}'")
    print(f"Quote character: '{dialect.quotechar}'")

The Sniffer works by analyzing character frequency patterns across multiple lines. A simpler frequency-based approach you can implement in any language:

function detectDelimiter(text) {
  const candidates = [',', ';', '\t', '|'];
  const lines = text.trim().split('\n').slice(0, 5);

  // The correct delimiter appears the same number
  // of times on every line
  for (const delim of candidates) {
    const counts = lines.map(line => {
      // Don't count delimiters inside quoted fields
      let count = 0, inQuotes = false;
      for (const ch of line) {
        if (ch === '"') inQuotes = !inQuotes;
        else if (ch === delim && !inQuotes) count++;
      }
      return count;
    });
    // All lines should have the same count, and > 0
    if (counts[0] > 0 && counts.every(c => c === counts[0])) {
      return delim;
    }
  }
  return ','; // Default fallback
}

Handling Delimiters in Data

What if your data contains the delimiter character? CSV handles this through quoting:

Name,Address,City
John,"123 Main St, Apt 4",New York
Jane,"456 Oak ""Ave""",Los Angeles

Rules for quoting:

  • Wrap the field in double quotes if it contains the delimiter
  • Wrap the field in double quotes if it contains a line break
  • If the field contains quotes, double them (" becomes "")

Choosing the Right Delimiter

Use comma for general-purpose CSV files, especially for US audiences or APIs

Use semicolon when working with European data or when data contains commas

Use tab when copying from spreadsheets or when data might contain both commas and semicolons

Use pipe for database exports or when all other common delimiters appear in your data

Specifying Delimiters in Popular Tools

Different applications handle delimiter specification in different ways:

Microsoft Excel

Excel uses your Windows regional settings to determine the CSV delimiter. To change it: Control Panel → Region → Additional Settings → List Separator. Changing this from comma to semicolon (or vice versa) changes how Excel reads and writes CSV files.

Google Sheets

When downloading as CSV, Google Sheets always uses comma as the delimiter. When importing, it auto-detects the delimiter. You can override this by using File → Import → Upload → Custom separator.

Python (pandas)

# Reading with a specific delimiter
df = pd.read_csv('data.csv', sep=';')

# Writing with a specific delimiter
df.to_csv('output.csv', sep='\t', index=False)

PostgreSQL COPY

COPY table FROM '/path/data.csv'
  WITH (FORMAT csv, DELIMITER ';', HEADER true);

Converting Between Delimiters

Need to change the delimiter in your file? Our Text to CSV Converter lets you:

  • Input data with any delimiter (tab, space, comma, semicolon, pipe, or custom)
  • Output as standard comma-separated CSV or semicolon-separated CSV
  • Handle proper quoting and escaping automatically

Key Takeaways

  • CSV files can use different delimiters despite the name
  • Comma is standard in US/UK; semicolon is standard in Europe
  • Regional decimal separators influence delimiter choice
  • Use quoting to handle delimiter characters within data
  • Tab is the safest choice when delimiter content is uncertain