Understand your CSV before importing it
Inspect a CSV without changing its values. Find uneven rows, repeated records, hidden characters and spreadsheet import traps. Profiles explain type suggestions, blanks, distinct values, lengths and samples. Copy a profile CSV or draft CREATE TABLE SQL for SQL Server, PostgreSQL or SQLite.
CSV import checks in practice
Keep ZIP codes as text
Input
zip 02134 10001
Result
name,inferred type,SQL type,blanks,distinct,unique,min,max,min length,max length,issues zip,text,nvarchar(50),0,2,yes,,,5,5,Leading zeros: 1 (line 2)
The leading zero makes this column text. A padded text length leaves room beyond this sample.
A mostly numeric column with N/A
Input
quantity 12 N/A 3
Result
name,inferred type,SQL type,blanks,distinct,unique,min,max,min length,max length,issues quantity,text,nvarchar(50),0,3,yes,,,1,3,Null-like text: 1 (line 3)
The default keeps N/A literal, so the column is text. Enable Treat NULL, N/A and - as blank only when those tokens mean missing data.
Spot an extra comma
Input
name,quantity Avery,12 Sam,3,extra
Result
name,inferred type,SQL type,blanks,distinct,unique,min,max,min length,max length,issues name,text,nvarchar(50),0,2,yes,,,3,5, quantity,integer,int,0,2,yes,3,12,1,2,
The record beginning on line 3 has three fields instead of two. Inspection reports it without changing or dropping source data. Correct the input before using table-conversion next steps.
How to inspect a CSV
- Paste CSV or open a file from your device. Choose the separator and whether the first row contains headers.
- Review file-level findings and column profiles. Locations refer to the line where a record begins, including records containing quoted line breaks.
- Keep the profile CSV, or choose CREATE TABLE and edit the table name, dialect, column types, sizes, nullability and optional primary key.
- Copy or download the report. Next steps use the original CSV for INSERT generation, JSON, XML or hidden-character inspection; they do not use the profile as source data.
CSV inspector questions
Why is my ID column text?
Leading zeros or integers beyond the SQL bigint range force text so every digit survives. Mixed, scientific-notation and uncertain values also stay text. The inspector never changes the source values.
Why isn't the text length the longest value?
A sample cannot prove how long future values will be. The suggestion uses the next larger size: 50, 100, 255, 500, 1000, 4000, then max. You can edit it. SQL Server uses nvarchar, PostgreSQL uses varchar or text, and SQLite uses TEXT.
Does it change my data?
No. Inspection and SQL edits leave the input unchanged. The output is a report or a table definition, not cleaned CSV. Treating NULL, N/A and - as blank changes the analysis only; none remains literal text. Nothing is uploaded.
Why does SQL Server default to nvarchar?
nvarchar stores Unicode, including Curaçao and São Tomé, without assuming a varchar code page. Suggested SQL Server lengths also allow for emoji occupying two UTF-16 units. Review sizes for your real data.
Why does Excel break long numbers?
Excel preserves only 15 significant numeric digits. Import identifiers and long numbers as text to keep them exact. Once a spreadsheet has rounded a value, the inspector can flag the risk but cannot reconstruct the missing digits.
Is a suggested primary key guaranteed to work?
No. Unique with no blanks describes this sample only. Nothing is selected automatically. Database collation can treat different spellings as equal, and future data may contain duplicates. Review those rules before choosing a key.
Conservative suggestions, not a database import
Up to 10 MiB and 250,000 cells, including missing-cell expansion. Lists initially show 12 entries; profiles cover every row. Distinct counts exclude blanks. ISO datetimes accept optional seconds, 1–7 fractional digits, Z or offsets up to ±14:00. Zoned values use datetimeoffset/timestamptz/TEXT; mixing zoned and unzoned values stays text. PostgreSQL stores six fractional digits and normalizes zones; choose text to preserve the original spelling. Decimal suggestions stop at 38 digits. SQLite dates use TEXT. SQL supports 100 columns and one primary key. Invalid headers block SQL; uneven rows block table handoffs. Headerless CSV gets generated names for SQL; XML needs headers.