File tools · CSV

Convert a CSV to UTF-8 or change its delimiter.

Fix accents that turn into question marks, switch a semicolon file to commas for an importer, or add the byte order mark Excel wants. The detected encoding is shown before you convert.

What it shows first: the encoding and delimiter it detected, the line endings, and any characters it could not decode, so you can see a problem before you write a new file.

How the encoding is detected

A CSV file carries no label saying which character encoding it uses, so the tool works through a fixed order. First it looks for a byte order mark: EF BB BF means UTF-8, FF FE means UTF-16 little-endian and FE FF means UTF-16 big-endian. With no mark, a file in which every other byte is zero is read as UTF-16, which is typical of ASCII text saved as UTF-16 without a mark. Otherwise the bytes are tested for strictly valid UTF-8; if they pass, the file is UTF-8. If not, it is read as Windows-1252, the code page behind most Western European exports from Windows software.

The last step is a guess, and the page says so. Windows-1252 accepts almost any byte, so it never fails, but a file in another legacy code page (Central European Windows-1250, Cyrillic Windows-1251, Shift_JIS, GB18030, Big5, EUC-KR) will come out as the wrong letters. If the preview looks wrong, set the input encoding yourself from the list; the preview updates immediately.

Delimiters, and why files use semicolons

RFC 4180 defines the comma only. Many spreadsheet programs write semicolons instead when the system uses a decimal comma, so 3,14 is a number and cannot also be a field separator. Tab and pipe files are common in database and mainframe exports. The tool detects the delimiter by trying each candidate on the first 50 records, honouring quotes, and choosing the one that gives the most consistent column count; you can override it. Changing the delimiter re-quotes any field that now contains the new delimiter, so a value like 1;5 survives a move to a semicolon file.

Your file stays on your device

Decoding and re-encoding use your browser’s built-in TextDecoder and TextEncoder inside a sandboxed frame that has no network access, so a file that contains names or account numbers is never sent for conversion. Output can be written as UTF-8 (with or without a byte order mark), UTF-16 little-endian with a mark, or Windows-1252.

Worked example

A supplier sends Café;€5 saved by an older Windows program. The bytes are 43 61 66 E9 3B 80 35, which is not valid UTF-8 because E9 is followed by 3B. The tool reads it as Windows-1252 (E9 is é, 80 is €), detects the semicolon, and shows the preview. Converting to comma-separated UTF-8 writes Café,€5 in the UTF-8 encoding, where the é takes two bytes and the euro sign three. Converting the other way to Windows-1252 would write one byte each, but only for characters that code page contains.

Byte order marks and Excel

The Unicode FAQ describes a byte order mark in UTF-8 as optional, a signature that marks an otherwise unlabelled file as UTF-8, and warns that it can confuse programs that expect plain ASCII at the start. Both things are true for CSV: some importers choke on the three extra bytes, and many Excel versions need them to read accented text correctly when you double-click a file. That is why this page offers both. If a web service rejects your file or its first column name looks odd, convert without the mark; if Excel shows é where you expected é, convert with it.

Common mistakes

What this tool does not do

It does not change any cell value, fix number or date formats, or repair malformed quoting. It can write only UTF-8, UTF-16 LE and Windows-1252, though it can read the other encodings in the input list. To check structure before converting, use the CSV validator.

Frequently asked questions

How do I convert a CSV to UTF-8?

Choose the file, check that the preview shows the right letters, leave the output encoding on UTF-8 and press Convert and download. If the preview is wrong, set the input encoding by hand first.

How does it know the encoding?

It checks for a byte order mark, then for the zero-byte pattern of UTF-16, then whether the bytes are valid UTF-8, and otherwise falls back to Windows-1252. The last step is a guess, which is why you can override it.

Should I add a byte order mark?

Add it when Excel shows garbled accents; leave it off when an importer or script complains about odd characters in the first column name. Behaviour differs between programs and Excel versions.

Can it change a semicolon file to commas?

Yes. Detect or set the input delimiter, choose Comma as the output delimiter, and any field that contains a comma is quoted automatically.

Why do some characters become question marks?

Windows-1252 cannot store them. The page counts them and writes a question mark in their place. Use UTF-8 to keep every character.

Is my file uploaded?

No. It is decoded, re-encoded and offered for download entirely in your browser tab, in a frame without network access.

What do the line endings do?

CRLF is the Windows convention and LF is used on macOS and Linux. Most programs read either; you can keep the input’s style or force one.

Sources

Detection is a best guess

Encoding detection for text without a byte order mark is heuristic. Check the preview against the original before you rely on the converted file.

Advertisement
Advertisement