How to detect inconsistent decimal separators in a CSV
Find mixed commas and periods in numeric CSV columns, separate decimal marks from field delimiters, and correct values without changing unrelated data.
A CSV column may contain values like 12.50 and 12,50 in different rows. That can lead to wrong totals or failed imports, but a comma in a CSV file might also separate fields instead of marking a decimal.
Use the CSV Editor to inspect the same numeric column across rows. The steps below help you tell mixed decimal marks from CSV formatting, then correct values without changing other data.
Check a CSV for mixed decimal separators
- Make a copy of the CSV first. Open the copy in the CSV Editor, which can open large files and lets you find, edit, and sort data.
- Find the column that should contain numbers, such as price, quantity, or tax. Check that the headers and values appear in the right columns. If many values have shifted into neighboring columns, the file may be using the wrong field delimiter.
- Compare several values in that same column. Look for the mark between the whole number and fractional part, such as
12.50or12,50. Check rows from different parts of the file, not just the first few. - Use the editor's find feature to look for a period and a comma, then inspect each matching value in context. A match elsewhere in the row might be punctuation or a field delimiter, not a decimal mark.
- Sort the column if it helps bring unusual values together. Treat the sorted view as a way to inspect patterns, not proof that the values were interpreted as numbers.
Write down a few examples and the rows they came from before editing. That makes it easier to check your changes against the original.
What the results mean
Every value uses the same decimal mark
If values consistently look like 12.50 or consistently like 12,50, the column appears consistent. Confirm that this format is accepted by the program that will import the CSV. Different programs and regional settings can expect different decimal marks.
The same column uses both commas and periods
Values such as 12.50 and 12,50 in the same column are a warning, but they do not tell you which format is correct. One mark may be a decimal separator and the other may separate thousands, or some rows may have been entered using a different locale. Check the source data or ask whoever prepared the file before converting anything.
Commas appear between fields
In a comma-delimited CSV, commas normally separate columns. A decimal comma can still appear inside a quoted field, for example "12,50". If that value is not quoted, a CSV reader may split it into two fields. A file that uses semicolons between fields can contain decimal commas without that same conflict, but the delimiter alone does not prove the decimal convention.
A value like 1,234 is unclear
1,234 could mean one thousand two hundred thirty-four or one and 234 thousandths, depending on the convention. Do not change this kind of value based on the punctuation alone. Look at other values, the source system's settings, or an authoritative example.
Values appear under the wrong headers
This points to a parsing problem, often because the file's field delimiter or quoting does not match how it was opened. Fix the import or parsing choice before judging decimal consistency. Otherwise, a comma inside a number may look like a separate field.
How to fix inconsistent values
- Check the CSV delimiter and quotes. Confirm that the file is being read with the character that actually separates its columns. Make sure values containing that character are quoted correctly. Do not replace punctuation until the rows and columns line up.
- Confirm the intended number format. Check the export settings in the system that created the file, its documentation, or a reliable original record. Decide whether decimals should use a period or comma, and whether thousands are grouped with a comma, period, or space.
- Correct only the affected numeric column. Work on your copy and change values according to the confirmed convention. For example, if the source confirms that
1.234,56means one thousand two hundred thirty-four and 56 hundredths, its period is a thousands mark and its comma is decimal. Replacing every comma with a period would not produce the intended value. - Leave ambiguous values for verification. If a value could reasonably mean either a decimal fraction or a grouped integer, compare it with the original record instead of guessing. A plausible-looking result can still be off by a factor of 1,000.
- Review the edited copy. Check the affected column again, along with several rows around each changed value. Confirm that no fields shifted and that unrelated text, dates, and identifiers remain unchanged before using the corrected file.
Why a CSV does not identify decimal marks
CSV is a text format, not a spreadsheet with stored number types. A cell containing 12,50 is just characters in a field. The file does not reliably tell another program whether the comma is a decimal mark, a thousands mark, or part of a value that should be treated as text.
For future exports, choose a consistent number format and a compatible field delimiter. If the receiving program has a required format, use that specification rather than relying on how the values look in a spreadsheet.
The CSV Editor opens and processes your file in the browser, so the CSV stays on your device.
