Fix CSV Encoding & Clean CSV Online
Repair CSV files: detect the encoding (UTF-8, UTF-16, Windows-1258/1252, TCVN3, VNI), the delimiter and header, trim cells, drop empty rows and duplicates, output UTF-8.
Result
Press “Run” to see the result.
CSV files exported from Excel and old Vietnamese software often arrive with garbled text (“Tª n”, “ViÖt Nam”, “Vieät Nam”), semicolons instead of commas, stray spaces and broken rows. The CSV cleaner detects the encoding by trying each candidate and checking which one produces real Vietnamese words: UTF-8 (with or without BOM), UTF-16 from Excel’s “Unicode text”, Windows-1258 and Windows-1252, and text typed with the legacy TCVN3 (ABC) and VNI fonts, which it converts to Unicode.
It detects the delimiter (comma, semicolon, tab, pipe) and parses quoted fields correctly, then cleans the data: trims and collapses spaces, removes invisible characters and no-break spaces, drops empty rows, pads or truncates rows to the header width, makes header names unique and optionally removes duplicate rows. The report says what was detected and changed.
The output is a UTF-8 CSV (with BOM by default, so Excel opens it with Vietnamese characters intact; comma, semicolon or tab delimiter) or JSON records.
Use this in your code
curl -X POST "https://apibox.io.vn/v1/csv-clean" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"csv":"Tên; Tuổi ;Tỉnh\n\"Nguyễn Văn An\" ; 30 ;Hà Nội\n\nTrần Thị B;25\n","format":"json"}'const res = await fetch('https://apibox.io.vn/v1/csv-clean', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"csv": "Tên; Tuổi ;Tỉnh\n\"Nguyễn Văn An\" ; 30 ;Hà Nội\n\nTrần Thị B;25\n",
"format": "json"
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"https://apibox.io.vn/v1/csv-clean",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"csv": "Tên; Tuổi ;Tỉnh\n\"Nguyễn Văn An\" ; 30 ;Hà Nội\n\nTrần Thị B;25\n", "format": "json"},
timeout=30,
)
print(res.json())<?php
$ch = curl_init('https://apibox.io.vn/v1/csv-clean');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"csv":"Tên; Tuổi ;Tỉnh\\n\\"Nguyễn Văn An\\" ; 30 ;Hà Nội\\n\\nTrần Thị B;25\\n","format":"json"}',
]);
$response = curl_exec($ch);
print_r(json_decode($response, true));API documentation → Get a free API key
FAQ
Why does Excel show broken Vietnamese in my CSV?
Excel opens CSV files as Windows-1258 / 1252 unless they start with a UTF-8 BOM. The cleaned output has a BOM by default (bom=false to remove it).
Can it fix text typed with .VnTime fonts?
Yes, TCVN3 (ABC) and VNI-Windows text is detected and converted to Unicode, even inside an otherwise UTF-8 file.
How big can the file be?
Up to the file size limit of your plan.