ShiftTools ShiftTools
Zero-Upload Browser Utility

CSV Cleaner & Formatter

Clean messy CSV files in your browser. Remove duplicate rows, trim cell whitespace, drop empty lines, normalize delimiters, and export clean CSV or JSON.

Interactive Tool Workspace

Loading local in-browser WebAssembly engine & hardware cryptographic sandbox...

Spreadsheet exports from CRMs, bank statements, and web scrapers almost always arrive with blank rows, trailing spaces that break VLOOKUP and database imports, duplicate email entries, or mismatched semicolon delimiters. This browser-based CSV cleaner parses your tabular data locally, removes empty rows and duplicate records, trims invisible leading/trailing whitespace across every cell, lets you filter or reorder columns, and exports pristine RFC 4180 CSV or structured JSON with zero server uploads.

Where messy CSV files cause database and spreadsheet headaches

Importing a raw .csv file straight into PostgreSQL, Airtable, Notion, HubSpot, or a billing script often fails on row 4,182 because of invisible formatting quirks:

  • Invisible trailing spaces ("[email protected] "): A single trailing space at the end of an email address or SKU causes SQL joins, uniqueness checks, and Excel XLOOKUP formulas to fail silently.
  • Duplicate customer leads or transaction rows: Merging three regional mailing lists and needing to deduplicate rows either across the entire row or by a specific key column (like email or user_id).
  • Blank spacer rows and broken line endings (CRLF vs LF): Accounting software exports that insert empty summary lines every 50 rows, causing automated CSV parsers to crash with null column errors.
  • Semicolon (;) or Tab (\t) delimiter mismatches: Opening a European Excel CSV export (which uses semicolons ; as the field separator because commas are used for decimals) in a US system that expects standard commas ,.
  • Converting CSV tables to JSON arrays: Turning a cleaned spreadsheet into a ready-to-import .json array of objects for a frontend app or API seed script.

Cleaning and transforming a CSV file step by step

  1. Load your CSV or TSV data: Drag a .csv, .tsv, or .txt file into the dropzone, or paste raw comma/tab-separated text directly into the input box.
  2. Verify delimiter and header row: Let the parser auto-detect commas (,), semicolons (;), tabs (\t), or pipes (|), and confirm whether Row 1 contains column headers.
  3. Apply one-click cleaning rules: Toggle Trim Cell Whitespace, Remove Empty Rows, Remove Duplicate Rows (full row or by specific column), and Remove Empty Columns.
  4. Inspect the interactive data table: Preview the before-and-after row counts, sort or filter rows, or rename/drop unneeded columns right in the grid.
  5. Export Clean CSV or JSON: Click Download CSV for a standardized comma-separated file or Export as JSON to download an array of keyed JSON objects.

Built-in data hygiene features

RFC 4180 quote-aware parsing

Naive scripts that split CSV lines with line.split(",") break immediately whenever a cell contains a quoted address like "142 MG Road, Suite 4B, Bengaluru" or an embedded newline inside quotes. Our state-machine parser respects double-quoted fields and escaped quotes ("") so commas inside addresses and product descriptions never shift your columns out of alignment.

Smart deduplication with live removed-row counter

You can deduplicate exact full-row matches or deduplicate by a specific primary key column (such as keeping the first occurrence of each unique Email address in a lead list) while seeing the exact count of removed duplicates (e.g., 1,240 rows → 1,085 unique rows).

Cell whitespace trimming and case normalization

Enabling Trim Whitespace strips leading and trailing spaces (\s+) and non-breaking spaces (\u00A0) from every single cell in the dataset in milliseconds, while optional case helpers normalize headers (snake_case, lowercase) or email columns.

A real example: cleaning a 1,500-row event registration export for CRM import

Suppose you export registrations from three webinar landing pages into webinar_leads_raw.csv (1,500 rows, 6 columns: Full Name, Email, Company, Role, Country, Notes).

  1. Drop webinar_leads_raw.csv into the CSV Cleaner.
  2. Enable Remove Empty Rows: 42 blank separator rows at the bottom of each merged sheet are removed (1,458 rows remaining).
  3. Enable Trim Whitespace: 319 cells that had trailing spaces after email addresses or company names are trimmed cleanly.
  4. Enable Remove Duplicates (keyed on the Email column, case-insensitive): 168 attendees who registered twice are consolidated (1,290 unique leads remaining).
  5. Drop the empty Notes column and click Download Clean CSV (or Export JSON). Your file imports into HubSpot or PostgreSQL on the first try with zero validation errors.

Practical tips and limitations

  • Multi-sheet .xlsx Excel workbooks: .csv is a plain-text single-sheet format. If you have a multi-tab .xlsx workbook in Excel or Google Sheets, export the active sheet as .csv (File → Download → Comma-separated values) before loading it here.
  • Leading zeros in ZIP codes and phone numbers (01234): The CSV Cleaner preserves leading zeros ("01234") accurately in the exported text file. However, if you double-click the exported .csv in Microsoft Excel, Excel's default auto-formatting will strip leading zeros unless you import the column as Text via Excel's Data → From Text/CSV wizard.

Privacy and local browser execution

CSV spreadsheets regularly contain customer names, email lists, phone numbers, payroll figures, and bank transactions. This tool runs 100% locally in your browser's memory with zero fetch, XMLHttpRequest, or WebSocket calls. Your tabular data never leaves your computer.

Handling UTF-8 BOM, line-ending normalization (CRLF vs LF), and null cells

Cross-platform CSV exchanges frequently run into character encoding and line-break mismatches between Windows, macOS, and Linux:

  • Line break standardization (\r\n vs \n): Windows spreadsheet tools terminate rows with Carriage Return + Line Feed (CRLF), whereas Unix CLI scripts (awk, cut, Python pandas) often output LF. The cleaner normalizes mixed line endings across the entire file so row counts never split mid-record.
  • Consistent column arity across rows: If Row 1 declares 6 header columns (id,name,email,role,plan,created_at) and Row 84 only has 4 commas because the trailing two fields were omitted, strict SQL COPY commands abort the import. Padding short rows with empty string cells ("") ensures every row in the exported CSV has the exact same number of columns as the header.

Related tools

If you export your cleaned spreadsheet as JSON, you can inspect or format nested structures in the JSON Formatter & Validator. To compare two versions of a CSV file line by line, open the Diff Checker, or build custom column pattern filters in the Regex Tester. Read our full tutorial on how to use the CSV cleaner.

Frequently Asked Questions

Are my CSV spreadsheets or customer email lists uploaded to a server?

No. All CSV parsing, whitespace trimming, deduplication, and JSON conversion execute 100% locally inside your browser tab. Not a single cell of your spreadsheet is ever transmitted over the internet.

How does the tool handle commas inside quoted text fields?

The parser follows the RFC 4180 CSV specification. Any comma wrapped inside double quotes (such as "Chennai, Tamil Nadu" or "1,250.00") is treated as part of that cell's text rather than a column break.

Can I convert a semicolon-separated (;) or tab-separated (.tsv) file into a standard comma CSV?

Yes. When you load a semicolon- or tab-delimited file, the tool detects the input separator automatically and lets you export the cleaned table using standard commas (,) or JSON.

How does duplicate row removal work?

By default, duplicate removal compares the trimmed values of every column in a row and keeps the first occurrence while discarding subsequent identical rows. You can also deduplicate based on a specific key column (such as email or id).

Can I convert my cleaned CSV directly into a JSON file?

Yes. Clicking Export JSON uses your first row's column headers as object keys and converts every data row into a structured JSON object inside a valid JSON array.

Why did Excel remove the leading zeros from my ZIP codes after I opened the cleaned CSV?

The CSV file itself keeps the leading zeros intact as text (which you can verify by opening the .csv in Notepad or VS Code). When opening the file in Excel, use Data → From Text/CSV and set the column type to Text so Excel does not convert 00501 into the integer 501.