Free Web Tools | digtoolsdigtoooooools

Fix CSV Encoding for Excel — BOM & Line Ending Converter

📖 About🔰 How to Use📚 Glossary⚙️ Technical Details❓ FAQ💡 Use Cases
🔒
100% Browser-Based

Your data is never sent to any server

📝
No Registration

Use instantly — no account or login required

Auto-Convert

Real-time preview with instant option changes

📂
Drag & drop your CSV file here
or
CSV / TSV / TXT — processed in your browser
  • CSV files saved from Excel may be encoded in Shift_JIS (CP932).

  • The original filename is automatically used as the base name.

* All processing happens in your browser. No data is sent to any server.

If both "Add BOM" and "Remove BOM" are enabled, the existing BOM is removed first, then a single BOM is added.

Convert

A free online tool that fixes CSV encoding issues — garbled Japanese text in Excel, broken line endings, and BOM (Byte Order Mark) problems. Add or remove UTF-8 BOM and convert line endings (LF / CRLF) instantly in your browser.

Supports reading Shift_JIS (CP932) encoded CSV files with automatic encoding detection. Features include trailing whitespace removal, final newline insertion, character/byte count display, and a 20-line preview.

All processing is done entirely in your browser — your data is never uploaded to any server. No registration, no installation, no sign-up. Just drag and drop your CSV file to get started.

Load your CSV file

Drag and drop a file onto the drop zone, click "Select File", or paste CSV content directly. For Shift_JIS files, change the input encoding setting.

Configure conversion options

Enable "Add UTF-8 BOM", choose your line ending format (LF/CRLF), and adjust other options. With "Auto-update" on, results update instantly.

Copy or download the result

Copy the converted text to clipboard or download it as a CSV file. The filename is auto-generated from the original.

BOM (Byte Order Mark)
A sequence of bytes (EF BB BF for UTF-8) placed at the beginning of a file to signal its encoding. Excel uses BOM to correctly identify UTF-8 files — without it, Japanese text may appear garbled.
UTF-8
The world's most widely used character encoding. It's compatible with ASCII and can represent virtually all characters from every language. It's the de facto standard for web pages and APIs.
Shift_JIS (CP932)
A legacy Japanese character encoding commonly used in Windows. Excel often saves CSV files in this format. Opening such files in a UTF-8 environment causes garbled text.
Line Ending / Newline
A control character that marks the end of a line. LF (Line Feed, \n) is standard on Unix/macOS, while CRLF (Carriage Return + Line Feed, \r\n) is standard on Windows. Mixing them can cause display issues.
CSV (Comma-Separated Values)
A plain text data format where values are separated by commas. Widely used for data exchange between spreadsheets, databases, and applications. TSV uses tabs instead of commas.
Mojibake (Garbled Text)
The display of incorrect or meaningless characters when a file's encoding doesn't match the reader's expected encoding. Solved by adding BOM or specifying the correct encoding.
Trailing Whitespace
Invisible spaces or tabs at the end of lines. They can cause issues in data processing, diff comparisons, and CSV imports. Removing them is recommended.

How UTF-8 BOM Works

The UTF-8 BOM consists of 3 bytes (0xEF, 0xBB, 0xBF) at the start of a file. While the Unicode specification states BOM is unnecessary for UTF-8, Windows applications like Excel and Notepad use it to identify UTF-8 encoding. This tool inserts or removes the U+FEFF character at the start of the string.

Browser-Based File Processing

Files are read using the HTML5 FileReader API as an ArrayBuffer, then decoded using TextDecoder. In auto-detection mode, the tool decodes with both UTF-8 and Shift_JIS, then selects the encoding with fewer replacement characters (U+FFFD). All processing runs entirely in browser memory with zero network communication.

Line Ending Conversion

Line ending conversion uses a two-pass regex approach: first normalizing all endings to LF (\n) by replacing CRLF and standalone CR, then converting to the target format. This ensures consistent results even with mixed line endings.

Q. My CSV shows garbled text in Excel. How do I fix it?
A. Enable "Add UTF-8 BOM" and download the file. Excel on Windows requires BOM to correctly identify UTF-8 encoding. Without it, Japanese and other non-ASCII characters appear garbled.
Q. My Shift_JIS CSV shows garbled text when loaded.
A. Change "Input Encoding" to "Shift_JIS (CP932)". This tool outputs UTF-8 but can read Shift_JIS input. Auto-detection usually works, but manual selection is more reliable.
Q. Should I use LF or CRLF line endings?
A. Use CRLF for Excel and Windows applications. Use LF for web development, Linux, and macOS. When in doubt, CRLF is the safer choice for Excel compatibility.
Q. Is my data sent to any server?
A. No. All file reading, conversion, and downloading happens entirely in your browser. Absolutely no data is transmitted to any server.
Q. Does it work on mobile devices?
A. Yes. The tool is fully responsive and works on smartphones and tablets. You can select files using your device's file manager.
Q. What's the difference between adding and removing BOM?
A. BOM is a marker that helps applications identify UTF-8. Adding BOM is useful for Excel; removing it is better for server-side processing or programming, where BOM can cause unexpected behavior.
Q. Can I process large CSV files?
A. Yes, up to approximately 2.5 million characters. For larger files, split them into smaller parts before processing.
📊

Fix Excel CSV Encoding

Solve garbled Japanese text when opening UTF-8 CSV files in Excel by adding BOM with a single click.

💻

Standardize Line Endings

Unify line endings across Windows (CRLF) and Unix/macOS (LF) to prevent diff noise and processing errors.

📁

Pre-process Database Exports

Clean trailing whitespace and normalize BOM in database exports before importing into other systems.

🔄

Cross-Platform CSV Sharing

Prepare CSV files with the correct encoding and line endings for team members on different operating systems.

Text Analysis