Text Delimiter Converter

Convert between text delimiters

arrow_forward
Source text
Converted text
Understanding Text Delimiters
TL;DR

Delimiter conversion transforms text between separators — commas, tabs, pipes, semicolons, newlines. The bridge between CSV, TSV, and other formats.

What is a Delimiter?

A delimiter is a character (or sequence of characters) used to separate distinct values within a text string or file. Delimiters are the invisible scaffolding of structured text data — they tell parsers where one value ends and the next begins.

The most common delimiters are comma (,), tab (\t), pipe (|), semicolon (;), and newline (\n). Each has strengths and weaknesses depending on the data being separated and the systems consuming it.

Delimiter conversion transforms text from one separator to another — for example, converting comma-separated values to tab-separated values, or replacing pipes with newlines. This is a simple but essential operation when moving data between systems that expect different formats.

Common Delimiters

DelimiterCharacterFormat NameBest For
Comma,CSVGeneral data exchange, spreadsheets
Tab\tTSVSpreadsheet paste, data with commas in values
Pipe|PSVData that contains commas and tabs
Semicolon;CSV (European)European locales where comma = decimal
Newline\nOne per lineLists, log entries, config values
Space(space)Space-separatedSimple word lists, command arguments

Why So Many?

The proliferation of delimiters exists because no single character is universally safe. Commas appear in addresses (“New York, NY”), names (“Smith, John”), and numbers in European locales (“1.234,56”). Tabs are invisible and can be confused with spaces. Pipes are rare in natural text, making them safer for data — but less human-readable.

The choice of delimiter depends on your data content and your target system. When in doubt, tabs are often the safest choice because they rarely appear in natural text.

The CSV-in-France Trap

One of the most common data exchange headaches involves locale-dependent CSV behavior:

  • In the US and UK, the decimal separator is a period: 3.14
  • In France, Germany, and most of Europe, the decimal separator is a comma: 3,14

Since CSV uses comma as the field separator, this creates a conflict. European versions of Excel solve it by using semicolon as the CSV delimiter instead. A perfectly valid US CSV file will appear as a single column in French Excel because Excel interprets the commas as decimal separators, not field separators.

The reverse is also true: a semicolon-separated file from a European system will load incorrectly in US Excel.

Solutions:

  • Explicit specification: Use the sep=, or sep=; header line that Excel recognizes
  • TSV instead: Tab-separated files avoid the comma/semicolon ambiguity entirely
  • Import wizard: Use Excel’s data import wizard to manually specify the delimiter instead of double-clicking the file

Escaping and Quoting

When a value contains the delimiter character itself, you need an escaping strategy:

Quoting: Wrap the entire value in double quotes. The delimiter inside quotes is treated as literal text, not a separator:

"Smith, John",42,"New York, NY"

Double-quoting: If a quoted value contains a double quote, it is escaped by doubling it:

"He said ""hello""",42

Backslash escaping: Some formats use \, to represent a literal comma. This is less common than quoting but used in some configuration file formats.

The RFC 4180 standard for CSV specifies quoting as the standard escaping mechanism. Values containing commas, double quotes, or newlines must be enclosed in double quotes.

Common Use Cases

  • Spreadsheet data exchange: Converting between CSV and TSV formats for compatibility with different spreadsheet applications and regional settings
  • Database import/export: Transforming delimiter-separated data to match the expected format of database import tools (COPY, LOAD DATA INFILE)
  • Log processing: Converting space-separated or pipe-separated log fields into comma-separated format for import into analysis tools
  • API response formatting: Converting API output (often JSON arrays) into delimiter-separated text for downstream consumption by scripts and spreadsheets
  • Clipboard operations: Converting newline-separated lists to comma-separated format for use in SQL IN clauses, email fields, or function arguments

Try These Examples

Comma to Tab Conversion Valid

Each comma is replaced with a tab character. The result is TSV (Tab-Separated Values) format, which can be pasted directly into Excel or Google Sheets with each value in a separate column.

Alice,Bob,Charlie,Diana
Text with Embedded Commas Valid

When values contain the delimiter character, they must be quoted. Converting to tabs removes the ambiguity — commas inside quoted values are preserved as literal characters, not treated as separators.

"Smith, John",42,"New York, NY"