A spreadsheet can display a file as a tidy grid even when another application refuses to import it. The importer may expect commas, a unique name above each column, and the same number of fields in every record. The spreadsheet can quietly interpret a different separator or tolerate an irregular row. Looking at the raw CSV helps explain why the two views disagree.
TinyToolbox CSV Validator checks whether pasted comma-separated data has a named header, correct quoting, and consistent record widths. Use it before an import to find structural errors, then check the business rules in the destination. A valid file can still contain a date the destination rejects or omit a required field.
Work from the text you intend to import
Open the CSV in a plain text editor. Copy the complete text, including the first record. If you copy selected cells from a spreadsheet, the clipboard may contain tabs rather than commas. To check the actual export, open the CSV file itself and copy from there. Keep an untouched original while you make corrections.
Look at the first few characters and lines. A header belongs at the start of the file. Remove any report title or notes that were placed above it in an inspection copy. Then check that commas separate the intended columns. A semicolon-delimited file can sometimes pass a comma-based check as a series of one-column records. A passing result therefore does not establish that the tool read the number of columns you expected. If your source uses another delimiter, export a comma-separated copy or check it with a workflow that supports that delimiter.
For a long file, locate a small set of complete records that reproduces the error. Take the original header and include every line inside any quoted multiline field. A slice beginning inside a quoted note can produce a new error that did not exist in the original export. Use a sample for diagnosis and validate the full corrected data when it fits the input limit.
Run the validator in TinyToolbox
- Open CSV Validator.
- Paste the data into CSV with a header row.
- Select Run tool.
- Read either the validation result and data row count or the error message.
- Correct the source and run the validator again on the new text.
The check runs in your browser and accepts up to one million characters. The tool displays a report and does not rewrite the CSV. Make corrections in your source editor or exporter so the file you later submit contains those changes. If you validate a snippet rather than the whole file, record which records it covered.
The reported data row count excludes the header. For example, a header followed by two records should report Data rows: 2. A header without data can be valid and report zero. If you expected records, check the original export’s filters and make sure it completed. A header-only file can be structurally valid and still be incomplete for your task.
Start with a known-good sample
The following CSV has three columns and two records:
id,name,note
0017,Sam Rivera,"Front row, if available"
0042,Alex Lee,
The comma inside the first note is part of the field because it is enclosed in double quotes. The second row has a trailing comma because its note is empty. With that comma present, it still has three fields. Removing the comma leaves only two fields and will trigger a width error.
Try validating the sample and then changing one thing at a time. Remove the quotes around the first note to see how the validator reports the extra column. Restore the quotes before testing the final delimiter. Using a known-good sample helps you see which punctuation is structural and which belongs to the text.
If you also need to inspect how these fields become named records, CSV to JSON uses the first row as keys and retains cell values as strings. In this example, the code 0017 stays a string with its leading zeros. That conversion is a separate step from validating the CSV.
Fix missing or duplicate header names
Every column needs a nonblank header. For example, id,,note has a missing name in the middle. Fill in the intended name or remove the corresponding column from every record if it should not be included. Removing only the empty header would change the width and might shift the data under the wrong names.
Exact duplicate names also fail. If a roster has date,date, decide which field represents each time and name them accordingly. If the receiving application publishes a template, compare your names directly with that template. In a human-readable report, Start date might be a good label. An importer may require start_date instead.
The validator catches exact duplicates. Headers that differ only in capitalization or contain extra spaces may still pass. A database import can treat them as equivalent, or the receiving application can require exact spelling. Review the names even when the validator accepts them. If you correct a header, check that each value still sits below the intended key before exporting again.
Diagnose malformed quoting
A cell containing a comma, a literal double quote, or an embedded line break should be enclosed in double quotes. Inside a quoted cell, write a literal double quote as two double quotes. The following note stays in one field:
id,note
0017,"The organizer wrote ""bring a notebook""."
If an opening quote has no closing partner, the parser may continue reading subsequent lines as part of the same cell. When the error refers to a missing closing quote, return to where the note begins. Look for a quote that was accidentally removed or for a literal quote that should have been doubled.
Characters following a closing quote also matter. Put the comma or the end of the record immediately after the closing quote. Stray spaces between them can cause a quoting error with this parser. If your exporter creates such fields repeatedly, correct the export settings or regenerate the CSV with a writer that handles the quoting. Editing many individual quotes is error-prone when cells contain real punctuation.
Interpret record numbers and unequal lengths
The record numbering used in errors includes the header. Record 2 is the first data record. If a previous quoted note contains a line break, the record number can differ from the physical line number in a text editor. Locate the record around recognizable values such as an ID or name and review the surrounding quotes. The width error tells you how many fields were read and how many the header requires.
For a record with extra fields, check for unquoted commas and unintended trailing delimiters. For a record with missing fields, check whether an empty final cell was omitted. If more than one cell is empty, there should be a separator between every neighboring pair of fields. A completely blank record can also look like one empty field where the header expects several columns. Remove stray blank records in the source, while preserving intentional blank lines inside quoted notes.
Suppose an export with four columns reports five fields on the first record containing a street address. Compare the address with a row that passed. If the extra separator belongs between the street and apartment text inside a single address field, quote the whole address rather than deleting the comma. That preserves the information and restores the intended column count.
Check the first bad record in a recurring export
Imagine a weekly inventory report usually validates, but one week it rejects a record near the end. The new item description includes a comma, while older descriptions do not. Open the original export as text and compare that record with a known-good record from the same file. Confirm that both contain the same intended fields and that each comma inside a description is enclosed by the field’s quotes.
If the report is generated by a script or another application, fix the export at its source when possible. A small sample with two rows can verify the correction. Give one row a simple description and the other a description with a comma and quotation marks. Export both at once and validate them. Then open the pasted data in CSV to JSON if you want to confirm that the second row still has the literal punctuation in its description. This checks that the exporter preserved the intended text as well as producing an accepted structure.
For the next scheduled export, compare the reported count with the number of records the source says it exported. If that count matches and the sample values are correct, try importing a copy in the destination’s normal workflow. A fix applied only to last week’s file will not prevent the error from recurring. Testing the updated exporter with a deliberately varied sample gives you a repeatable check when a new description introduces the same punctuation again.
Check what the importer needs after syntax passes
Run the validator again until it reports the expected number of data rows. Then verify required columns, accepted date formats, identifiers, and any rules about empty values. For a contact import, you might want to check a record with an empty phone number and one with an accented name. For an inventory import, inspect leading zeros and decimal separators before you submit.
Compare the exact file you will send with the text you validated. A spreadsheet can add formatting changes when saving another copy. If you regenerated the file after the last check, open that new export and test it again. Where the destination offers a preview, confirm that the columns are mapped correctly and the first and last records appear as intended.
Keep the original export and a clearly named corrected copy. When you report a recurring problem, include a small fictional example showing the header, one affected record, and the validator’s message. A reproducible sample helps identify whether the correction belongs in the source table or the exporter. The full import is ready when the CSV passes the structure check and the destination reads the expected records.
Verify a recurring export after a column is added
Suppose a weekly reservation export previously contained id,name,seats, and a revised version adds room. A complete header now has four fields, so a row whose room is unknown still needs a place for that field. Try validating this sample.
id,name,seats,room
0042,Sam,3,East
0043,Jo,2,
The final comma on Jo’s record represents an empty fourth field. Remove that comma in a test copy and run CSV Validator again. The second data record is now narrower than the header. Restore the delimiter in the test and check that the shape is valid. This isolates a structural problem from the policy question of whether the receiving system permits a blank room.
In the real export, check the first and last records and sample a record where the new field has a value. If a whole section of records has the old width, correct the exporter or produce another export with a consistent set of columns. Avoid filling unknown rooms with an arbitrary value just to pass validation. After structural validation, compare the header order and empty-field rules with the importer’s requirements. Keep the small sample as a reference for the next change to the export.