FIRST CH TOOLS / 11 ENCODING CONVERTER
Encoding & Line Ending Converter
Detects and converts the character encoding (Shift_JIS / UTF-8), BOM and line endings (CRLF / LF / CR) of CSV and text files. Handy for diagnosing garbled CSVs and for writing BOM-prefixed UTF-8 that Excel opens correctly.
Load the file itself to inspect line endings. Text pasted into the box has its newlines normalised to LF by the browser, so CRLF cannot be detected.
Convert
Output is UTF-8 only. Encoding to Shift_JIS is not supported: the browser's TextEncoder cannot do it and a full mapping table would be required. Reading and decoding Shift_JIS input is supported.
How to Use
- Load a fileDrag & drop or choose a file. Encoding, BOM and line endings are detected automatically.
- Check the previewIf the text looks garbled the detection may be wrong — judge from the preview.
- Convert and downloadPick the line endings and BOM, then download. Everything runs in your browser.
About This Tool
Garbled Japanese CSVs almost always come down to two things: Shift_JIS being read as UTF-8 (or vice versa), and a missing BOM. Excel tends to read BOM-less UTF-8 CSVs as Shift_JIS, so simply adding a BOM often fixes it. Mixed CRLF/LF line endings are a common cause of whole-file diffs in Git.
Detection checks whether the bytes are valid UTF-8 and falls back to Shift_JIS otherwise. Japanese CSVs are in practice one of these two, so narrowing the candidates reduces false positives. Other encodings such as EUC-JP are not supported.
From AI Agents
The encoding / BOM / line-ending detection and conversion logic behind this tool is also available as the encoding_convert tool of the MCP (Model Context Protocol) server @first-ch/tools-mcp, so AI agents can call it without a browser. See Using these tools from AI agents for setup.
Setup
claude mcp add firstch-tools -- npx -y @first-ch/tools-mcp
Example calls
# Detect only encoding_convert(text="text", mode="analyze") # Convert to UTF-8, LF endings, no BOM encoding_convert( base64="<base64>", mode="convert", newline="LF", bom=false)
Other Tools
- 01Batch Image → WebP ConverterWebP Converter
- 02White Background RemoverWhite BG Remover
- 03WCAG Contrast CheckerContrast Checker
- 04Character CounterCharacter Counter
- 05llms.txt Generatorllms.txt Generator
- 06JSON-LD GeneratorJSON-LD Generator
- 07Markdown → PDFMD → PDF
- 08OGP Meta Tag WizardOGP Wizard
- 09Favicon GeneratorFavicon Generator
- 10TikTok PublisherTikTok Publisher
- 12Batch Image → AVIF ConverterAVIF Converter
- 13Test Data GeneratorTest Data Generator
- 14Marp Markdown → SlidesMarp Slides
- 15Text & Code Diff CheckerDiff Checker
- 16Cron Expression ExplainerCron Explainer
- 17Base64 & Data URI EncoderBase64 & Data URI
- 18URL Parameter Editor & UTM BuilderURL Parameters
- 19HTML Entity Escape & UnescapeHTML Escape
- 20JSON ⇄ YAML ConverterJSON ⇄ YAML
- 21PX ⇄ REM / EM ConverterPX ⇄ REM / EM 単位変換
- 22Color Converter & AlphaColorコード変換&アルファ透過
- 23MD5 / SHA-256 Hash Generatorハッシュ生成
- 24JWT Decoder & Expiry CheckerJWTデコーダー&有効期限チェッカー
- 25User-Agent ParserUser-Agent解析&デバイス判定
- 26UUID & ULID GeneratorUUID (v4) & ULID 一括生成
- 27Aspect Ratio Calculatorアスペクト比計算&サイズ算出