csvkit.org
CSV (Comma-Separated Values) utilities, in the browser
Say hi →

Clean Numbers in a CSV

currency · thousands separators · percent · accounting negatives · nothing uploaded

A column of money that will not sum is almost always a column of strings. $1,234.50, (45), 12%, 1 234,50 and 3.5 kg are all numbers wearing formatting a spreadsheet put on them, and every tool downstream reads them as text. This takes the formatting off and leaves the number — and tells you, column by column, where it could not.

clean
Or drop a .csv file here, or
ready

How to clean numbers in a CSV

  1. Paste the CSV or drop a file. By default every column where every value converts is cleaned, and the rest are left exactly as they are.
  2. Read the report under the panes. It shows, per column, how many values converted and gives you examples of the ones that did not — usually n/a, , or a stray footnote.
  3. Pick a single column from the dropdown if you want to be specific, or (all columns) to attempt everything.
  4. Set decimals if you want a fixed number of places; leave it blank to keep whatever precision each value had.
  5. Copy or download. The file never leaves your browser.

What counts as formatting

How the decimal mark is decided

This is the part that quietly ruins data, so here is the exact rule. On detect, only the last separator in a value can be a decimal mark, and it only counts as one when the digits after it are not a group of exactly three. So 1,234 is one thousand two hundred and thirty-four, not 1.234 — because three trailing digits is what grouping looks like, and reading it the other way divides the value by a thousand without saying anything.

1.234,56 and 1,234.56 are both unambiguous and both come out as 1234.56. 1 234,5 is unambiguous too. Where you have a column that really does hold values like 1,234 meaning 1.234, set the decimal mark explicitly rather than trusting the guess.

Why a column is all-or-nothing

The default refuses to convert a column unless every non-blank value in it converts. That sounds strict and it is the whole point: a column where 999 values are prices and one is n/a is not a numeric column, and cleaning the 999 leaves you with a column that looks numeric, sorts wrong, and averages wrong — with no sign that anything happened.

When the report tells you which values blocked a column, you can decide: fix them at the source, blank them out with find & replace, or switch the last dropdown to clean what converts if you genuinely want a mixed column. Blank cells never block anything — they stay blank.

What it will not do

Privacy

100% client-side. Parsing and cleaning happen in this page; nothing is uploaded. See the privacy policy.