Home › Developer Tools › CSV Cleaner

CSV Cleaner

Paste or open a messy CSV export and get a tidy file back in one click. Stray spaces, invisible characters, blank rows and columns, duplicate rows, missing or repeated header names and inconsistent capitalization are fixed, and every changed cell is highlighted so you can check the result.

Last updated:

Cells
Rows and columns
Header row

    Cleaned data

    Advertisement
    Advertisement

    How to use the CSV Cleaner

    1. Paste your CSV or open a file. The delimiter (comma, semicolon, tab or pipe) is detected automatically.
    2. Review the cleanup options: the most common fixes are on by default; tick extras such as smart quote straightening or formula neutralizing.
    3. Fix the header row: fill in blank names, number duplicates and pick a naming style such as snake_case for databases.
    4. Check the report and preview: each fix shows how many cells or rows it changed, and changed cells are highlighted.
    5. Download the clean CSV or copy it, choosing the delimiter, line endings and Excel-friendly BOM.

    What each cleanup step fixes

    OptionBeforeAfter
    Trim spaces" Ana Ruiz "Ana Ruiz
    Collapse repeated spacesAna   RuizAna Ruiz
    Strip non-printing characters[email protected] + zero-width space (U+200B)[email protected]
    Fill blank and duplicate header namesName,,NameName,Column 2,Name 2
    Header style: snake_caseSignup Datesignup_date
    Straighten smart quotes and dashes“VIP” – call"VIP" - call
    Replace line breaks inside cells"Paid⏎in full"Paid in full
    Neutralize formulas=HYPERLINK("http://…")'=HYPERLINK("http://…")
    Even out ragged rowsA row with 3 fields in a 6-column filePadded with 3 empty fields

    Where messy CSV comes from

    • Copy and paste from web pages or PDFs brings non-breaking spaces, zero-width characters and smart quotes along with the text.
    • Form and survey exports keep whatever people typed: trailing spaces, ALL CAPS names and empty submissions.
    • Spreadsheet exports often include empty columns that once held formatting, blank rows between sections and duplicate header names.
    • Merged exports repeat the same records, which you see as exact duplicate rows.

    Header naming styles

    Databases, programming languages and import tools often reject spaces and punctuation in column names. snake_case (signup_date) suits SQL and Python; camelCase (signupDate) suits JavaScript and JSON; Title Case reads best in reports. After cleaning, convert the file with CSV to JSON or CSV to SQL, or look up values from another file with the CSV VLOOKUP Tool.

    Frequently asked questions

    What does the CSV Cleaner change?

    Only what the ticked options describe. By default it trims spaces at the start and end of each cell, collapses double spaces, removes invisible characters, deletes completely empty rows and columns, removes exact duplicate rows, pads short rows, and fills in blank or repeated header names. The order of rows and the content of cells are otherwise left alone.

    What are non-printing characters and why remove them?

    They are characters you cannot see but that break matching and imports: zero-width spaces (U+200B), byte order marks (U+FEFF) in the middle of a file, soft hyphens, control codes and non-breaking spaces (U+00A0) copied from web pages. A value like [email protected] followed by a zero-width space looks identical but will not match in a VLOOKUP or a database join. Non-breaking spaces and tabs are turned into normal spaces; the rest are deleted.

    How are duplicate rows detected?

    After the cells are cleaned, rows whose values are exactly the same in every kept column are duplicates, and only the first one is kept. Because cleaning runs first, ' Ben Okafor' and 'Ben Okafor' count as the same. To dedupe by a single column such as Email, use the CSV Duplicate Row Remover.

    Will it change my numbers, dates or leading zeros?

    No. The cleaner works on text only and never converts types, so ZIP codes like 02139, phone numbers and dates keep exactly their characters (apart from surrounding spaces). Changing text case only affects letters.

    What does Neutralize formulas do?

    Cells that begin with =, +, - or @ can be executed as formulas when a CSV is opened in Excel or Google Sheets (known as CSV or formula injection). With this option, such cells get a leading apostrophe so spreadsheets show them as text. Plain numbers such as -5 or +1 555 0100 are left alone.

    Can I clean very large CSV files?

    Yes. Files of tens of megabytes are cleaned in a few seconds; files too large to show in the text box are still cleaned in full and can be downloaded. Only the first 500 rows are shown in the preview.

    Is my file uploaded?

    No. The CSV is cleaned by JavaScript in your browser tab and never leaves your device.

    Are all the tools on FreeToolCabin tested for quality and accuracy?

    Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

    Related tools

    CSV Duplicate Row RemoverRemove duplicate rows from a CSV by all or selected columns and download the cleaned file.CSV ViewerOpen a CSV or TSV file as a sortable, filterable table.CSV Column ExtractorPick, reorder and rename CSV columns, filter rows by value, and export a new CSV or JSON.CSV VLOOKUP ToolJoin two CSV or Excel files on a key column like VLOOKUP, with left, inner and full joins.Bank Statement AnalyzerUpload a bank CSV to sort spending into categories, see monthly charts and your top merchants.Bulk Certificate GeneratorUse your own certificate design and a CSV of names to create a PDF certificate for every row.Bulk Find and ReplaceApply a whole list of find → replace pairs to your text at once, with a per-pair change log.Mail Merge Text GeneratorFill a {placeholder} template with CSV rows to create a personalized message for each person.JSON to Excel ConverterTurn JSON into a styled .xlsx spreadsheet; nested arrays become their own linked sheets.JSON to CSVConvert JSON data to CSV for spreadsheets.CSV to JSONConvert CSV data to JSON with live preview.Excel to CSVConvert XLSX spreadsheets to CSV.Excel Viewer (XLSX / XLS)Open XLSX, XLS and ODS spreadsheets in your browser without Excel.Line Ending ConverterConvert text and files between CRLF, LF and CR line endings.Markdown to HTMLConvert Markdown to clean HTML with a live editor.XML to JSONConvert XML to JSON with validation.Text Encoding ConverterDetect and convert text file encodings like UTF-8, UTF-16 and Latin-1.JSON ViewerExplore JSON as a collapsible tree, search keys and values and copy any node's path.TTF to WOFF2 ConverterConvert TTF and OTF fonts to WOFF2 or WOFF and get a ready @font-face CSS snippet.Chmod CalculatorConvert Linux file permissions between checkboxes, octal (755) and symbolic (rwxr-xr-x) notation.JSON to TypeScriptGenerate TypeScript interfaces or types from JSON, with nested types and optional fields.Morse Code TranslatorTranslate text to Morse code and back, then play it as sound or a blinking light, or save a WAV.HTML Table GeneratorBuild HTML tables in an editable grid with styles, header rows, CSV import and live preview.Hex to Text ConverterConvert hex to text and text to hex with UTF-8 support and space, 0x, \x or comma formats.JSON to XML ConverterConvert JSON to well-formed XML with attributes, arrays and pretty print.JSON to YAML ConverterConvert JSON to clean YAML as you type, with indent, quoting and sort options.YAML to JSON ConverterConvert YAML to pretty or minified JSON, with errors pinned to the exact line.HTML to Markdown ConverterTurn HTML or pasted rich text into clean Markdown with tables and live preview.Markdown Table GeneratorBuild Markdown tables in a grid or paste from Excel/CSV, with alignment and preview.JSON ValidatorCheck JSON with the exact line and column of each error, fix tips and one-click auto-fix.Image to Base64Convert images to Base64 data URIs, CSS backgrounds and HTML img tags in your browser.Base64 to ImagePaste a Base64 string or data URI to preview, identify and download the image.JSON CompareCompare two JSON documents and see every added, removed and changed path.Hex to DecimalConvert hex to decimal instantly with steps and signed mode.Decimal to HexConvert decimal to hex instantly with steps and signed mode.Binary to DecimalConvert binary to decimal instantly with steps and signed mode.Decimal to BinaryConvert decimal to binary instantly with steps and signed mode.Two's Complement CalculatorDecimal to two's complement binary and back for 4-64 bits, with invert-and-add-1 steps.File to Base64Convert any file to a Base64 string or data URI with MIME detection, line wrap and download.HTML Table to CSVExtract any table from HTML or page source to CSV, TSV or JSON, with colspan and rowspan handled.IEEE 754 Floating Point ConverterConvert decimals to 32/64-bit IEEE 754 floats: toggle bits, see hex, exact value and rounding error.INI to JSON ConverterConvert INI and CFG files to JSON and JSON back to INI, with sections, arrays and types.IP Address ConverterConvert IPv4 to decimal, hex, binary, octal and back, with class and private/public check.ISBN Converter & ValidatorConvert ISBN-10 to ISBN-13 and back, validate check digits and hyphenate, one or in bulk.JSON Flatten / UnflattenFlatten nested JSON to dot or bracket path keys, or unflatten flat keys back to nested JSON.JSON to Dart ClassTurn JSON into Dart model classes with fromJson, toJson, null safety and nested classes.JSON to Java ClassTurn JSON into Java POJOs or records with Lombok, getters/setters and Jackson or Gson annotations.JSON to Kotlin Data ClassTurn JSON into Kotlin data classes for kotlinx.serialization, Gson, Moshi or Jackson.JSON to Markdown TableTurn a JSON array of objects into a GitHub Markdown table with column picker and alignment.JSON to PHP ArrayConvert JSON to PHP array code (short [] or array()) and PHP arrays back to JSON.JSON to Rust StructTurn JSON into Rust structs with serde derives, rename attributes, Option and Vec types.JSON to SQL ConverterConvert a JSON array of objects to CREATE TABLE and INSERT statements for MySQL, Postgres, SQLite.JSON to Swift StructTurn JSON into Swift Codable structs with CodingKeys, optionals and nested types.JSON to TOML ConverterConvert JSON to clean TOML with tables, arrays of tables, inline tables and dates.JSONL to JSON ConverterConvert JSON Lines / NDJSON to a JSON array and back, with line-level error reports.Properties to YAML ConverterConvert Java .properties to nested YAML (application.yml) and YAML back to properties.PX to EM ConverterConvert pixels to em using the parent font size, and em back to px, with conversion tables.Query String to JSONConvert URL query strings to JSON with nested brackets and arrays, and JSON back to a query string.REM to PX ConverterConvert CSS rem values to pixels for any root font size, with a quick 0.25–6rem table.SQL to JSON ConverterConvert SQL INSERT statements and dumps into a JSON array of row objects, with CSV export.TSV to CSV ConverterConvert TSV to CSV and back, or between tab, comma, semicolon and pipe, with correct quoting.TypeScript to JavaScriptConvert TypeScript or TSX to clean JavaScript instantly: strip types, keep or compile JSX.XML to YAML ConverterConvert XML to clean YAML with attributes, text nodes, lists and exact error lines.YAML to XML ConverterConvert YAML to pretty, well-formed XML with custom root, attributes and array item tags.Boolean Algebra SimplifierSimplify boolean expressions or minterm lists to minimal SOP and POS with Quine-McCluskey steps.Compare Excel FilesCompare two Excel spreadsheets cell by cell, highlight changes and export a diff report.Remove Duplicates in ExcelFind and remove or highlight duplicate rows in XLSX or CSV files by the columns you choose.GeoJSON ViewerView GeoJSON on a map, inspect and edit properties, validate against RFC 7946 and export.
    See all 129 Data & File Format Converters →