CSV Column Type Detector
Detect likely text, number, date, boolean, and empty column types
CSV Column Type Detector — what it does
Scan every column and get a verdict on what kind of data it holds: text, number, date, boolean or empty. It profiles a file you did not create, before you write a formula, design a database table or trust a column to behave like the numbers it appears to contain.
Worked example
A seven-column staff export profiled before loading it into a database. The flag column holds 0/1 values, and amount uses thousands separators (52,000, 41,250.75) with one n/a among five values.
Input — staff-flags.csv
id,name,active,flag,hired,amount,notes 1,Ann Lee,yes,1,2021-03-15,"52,000", 2,Ben Ortiz,no,0,2019-11-02,"88,000", 3,Chloe Park,yes,1,2023-06-01,n/a, 4,Dev Patel,yes,0,2020-01-20,"41,250.75", 5,Emma Rossi,no,1,2022-09-12,"91,000",
Output — csv-column-types.csv (the same table is shown on the page)
Column,Type,Confidence,Samples id,number,100%,1 · 2 · 3 name,text,100%,Ann Lee · Ben Ortiz · Chloe Park active,boolean,100%,yes · no · yes flag,number,100%,1 · 0 · 1 hired,date,100%,2021-03-15 · 2019-11-02 · 2023-06-01 amount,number,80%,"52,000 · 88,000 · n/a" notes,empty,100%,
Amounts written with thousands separators count as numbers, so amount is number at 80% (four of five values parse; n/a does not). The 0/1 flag column is number, yes/no in active is boolean, notes is empty. In the download the samples cell is quoted because it contains commas.
When this tool helps
- Designing table columns or an import mapping for a dataset you have just received.
- Confirming that an amount column is genuinely numeric and not text with stray currency symbols.
- Finding columns that are entirely empty and can be dropped before analysis.
How to use it
- Choose the CSV file.
- Process the detection.
- Review the type assigned to each column.
- Download the report for your documentation.
Accuracy, limits, and good practice
- A column of postcodes or product codes made only of digits will read as numeric, which is exactly how leading zeros get lost on import.
- Detection is based on the values present, so a mostly numeric column containing one text entry may still be classified as text.
- Boolean detection recognises common true and false spellings; localised or numeric flags such as 1 and 0 read as numbers instead.
Frequently asked questions
Does it change my file?
No. This tool only reports; the CSV is left exactly as it was and no output data file is written.
How do I keep leading zeros?
Import the column as text in your destination system, or prefix values so they cannot be read as numbers.
Why is a date column reported as text?
Because the format is not parseable as written. Run the date normaliser to standardise it, then detect again.
What is the confidence threshold?
A type is assigned as soon as at least 80% of a column's non-empty values pass its test, checked in the order boolean, number, date. A column that fails all three is reported as text with 100%, whatever it contains.
Are European-style amounts such as 1.250,00 recognised as numbers?
No. Only a comma between groups of three digits before an optional decimal point is accepted: 1,250, 1250 and 12,500.75 are numbers. In a measured file, a column of 1.250,00 / 980,00 / 1.100,50 and a column of 12,50 / 1,2345 / 9,99 were both reported as text at 100%. Convert decimal commas to points first.
Related tools on this site
- CSV Group & Aggregate — Group rows and calculate sum, average, count, min, or max
- Split CSV by Column — Create separate CSV files for each field value
- JSON Formatter — Format and validate JSON
Further reading: Cleaning a CSV export before you import it anywhere · CSV, JSON, YAML, XML and Markdown Tables: When Each Fits and How to Convert
Everything above runs inside this page. CSV Column Type Detector needs no account, no upload, and no server round trip — close the tab and nothing is left behind.
CSV 欄位類型偵測能做什麼
掃描每一個欄位,判定它裝的是哪一類資料:文字、數字、日期、布林或空白。在你為別人給的檔案寫公式、設計資料表,或直接假設某欄真的是數字之前,先做一次剖析。
實際範例
七欄的員工匯整檔在載進資料庫前先做類型判讀。flag 欄是 0/1,amount 欄用千分位逗號(52,000、41,250.75),五個值裡有一個 n/a。
來源:staff-flags.csv
id,name,active,flag,hired,amount,notes 1,Ann Lee,yes,1,2021-03-15,"52,000", 2,Ben Ortiz,no,0,2019-11-02,"88,000", 3,Chloe Park,yes,1,2023-06-01,n/a, 4,Dev Patel,yes,0,2020-01-20,"41,250.75", 5,Emma Rossi,no,1,2022-09-12,"91,000",
得到:csv-column-types.csv(頁面上顯示同樣的表格)
Column,Type,Confidence,Samples id,number,100%,1 · 2 · 3 name,text,100%,Ann Lee · Ben Ortiz · Chloe Park active,boolean,100%,yes · no · yes flag,number,100%,1 · 0 · 1 hired,date,100%,2021-03-15 · 2019-11-02 · 2023-06-01 amount,number,80%,"52,000 · 88,000 · n/a" notes,empty,100%,
帶千分位逗號的金額也算數字,所以 amount 是 80% 的 number(五個值有四個能解析,n/a 不行)。0/1 的 flag 欄是 number,active 欄的 yes/no 是 boolean,notes 是 empty。下載檔裡範例值那格因為含逗號而加上引號。
什麼時候用得上
- 為剛收到的資料集設計資料表欄位或匯入對應。
- 確認金額欄真的是數值,而不是夾雜貨幣符號的文字。
- 找出完全空白、可在分析前直接移除的欄位。
使用步驟
- 選擇 CSV 檔案。
- 執行偵測。
- 檢視每個欄位被判定的型別。
- 下載報告存入文件。
精確度、限制與實務建議
- 全由數字組成的郵遞區號或商品代碼會被判為數值,這正是匯入時前置零消失的原因。
- 偵測依實際值判斷,因此以數字為主但夾雜一筆文字的欄位仍可能被判為文字。
- 布林偵測認得常見的 true/false 寫法;本地化字詞或 1 與 0 這類旗標會被判為數字。
常見問題
會改到我的檔案嗎?
不會。本工具只做報告,CSV 維持原樣,也不會輸出資料檔。
怎麼保住前置零?
在目標系統中以文字方式匯入該欄,或替值加上前綴,讓它不會被判讀成數字。
日期欄為什麼被判成文字?
因為現有寫法無法解析為日期。請先用日期格式統一工具標準化,再重新偵測。
可信度的門檻是多少?
某欄非空值裡至少 80% 通過某個測試就判為該類型,測試順序是布林、數字、日期。三個都不過的欄位一律報成 100% 的 text,不論內容為何。
1.250,00 這類歐式金額會被當成數字嗎?
不會。只接受小數點前每三位一個逗號的寫法:1,250、1250、12,500.75 都是數字。實測時,1.250,00/980,00/1.100,50 這一欄與 12,50/1,2345/9,99 這一欄都被報成 100% 的 text。請先把小數逗號改成小數點。
本站相關工具
延伸閱讀: 匯入之前先把 CSV 匯出檔清乾淨 · CSV、JSON、YAML、XML 與 Markdown 表格:各自適用的場合與轉換方法
以上步驟全部在這個頁面內完成,CSV 欄位類型偵測 不需要註冊、不上傳檔案、也不經過伺服器,關閉分頁後不會留下任何資料。