Comma Replacer
Replace commas with periods, semicolons, tabs, or any custom delimiter instantly. Paste text or upload a file for batch comma replacement.
About
Mismatched delimiters corrupt CSV imports, break decimal parsing across locales, and silently produce wrong numerical results. European systems use commas as decimal separators where Anglo systems use periods. Swapping a file between these conventions without a reliable replacement pass leads to data loss or truncated rows. This tool performs exact global substitution of any single-character or multi-character delimiter in your text. It operates entirely in-browser with zero server calls. Limitation: it performs literal string matching, not context-aware parsing. A comma inside quoted CSV fields is treated identically to a field separator. For strict RFC 4180 compliance, use a dedicated CSV parser.
Formulas
The replacement operation is a literal global substitution across the entire input string S. Given a source delimiter dsrc and a target delimiter dtgt, the output is:
The replacement count n equals the number of non-overlapping occurrences of dsrc in Sin. Internally this uses a compiled regular expression with all special regex characters escaped via the pattern escape(dsrc) = dsrc.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") to guarantee literal matching regardless of input content.
Where Sin = input string, Sout = output string, dsrc = source delimiter, dtgt = target delimiter, n = total replacements performed.
Reference Data
| Mode | Source | Target | Typical Use Case |
|---|---|---|---|
| Comma → Period | , | . | EU-to-US decimal conversion |
| Period → Comma | . | , | US-to-EU decimal conversion |
| Comma → Semicolon | , | ; | CSV for European Excel (list separator = ;) |
| Comma → Tab | , | \t | TSV generation for database import |
| Comma → Space | , | Readable list formatting | |
| Comma → Pipe | , | | | Pipe-delimited flat files (EDI, legacy systems) |
| Comma → Newline | , | \n | One-item-per-line lists |
| Semicolon → Comma | ; | , | EU CSV back to standard CSV |
| Tab → Comma | \t | , | TSV-to-CSV conversion |
| Pipe → Comma | | | , | Legacy flat-file to CSV |
| Colon → Comma | : | , | /etc/passwd style to CSV |
| Newline → Comma | \n | , | List to inline comma-separated values |
| Custom | User-defined | User-defined | Any arbitrary delimiter swap |