CruxDevCruxDev Tools Studio Prompts
text Utility • Zero-Server Privacy • 100% Client-Side

Text File Encoding Converter

Detect whether a text file is UTF-8, UTF-16, Windows-1252, Shift_JIS or another code page, preview it, then save it as UTF-8 with or without BOM and fix CRLF or LF line endings in bulk.

Overview

Detects the character encoding of text files and converts them to UTF-8 in your browser. It recognises byte-order marks, valid UTF-8, BOM-less UTF-16 and common legacy code pages such as Windows-1252, ISO-8859-2, Windows-1251, KOI8-R, Shift_JIS, GB18030 and EUC-KR. You can also normalise CRLF and LF line endings and convert many files at once.

How It Works

Drop one or more text files and each is analysed straight away, with the guessed encoding and a confidence figure shown in a table. Select a file to preview its text, see counts of CRLF, LF and CR line endings and the first 64 bytes in hex. If accented letters look wrong, choose a different source encoding from the list and the preview updates. Pick UTF-8, UTF-8 with BOM or UTF-16 LE with BOM as the output, choose a line ending style, then download one file or a ZIP of all of them.

Step-by-Step Usage Guide

  1. Drop the text, CSV or subtitle files whose encoding you want to check.
  2. Read the detected encoding and confidence for each file in the table.
  3. Preview a file and change the source encoding if any characters look garbled.
  4. Choose the output encoding and the line ending style.
  5. Download the converted file, or all files as a single ZIP.

Technical Specifications & Standards

Detection runs in a fixed order. A byte-order mark is decisive, so files starting with EF BB BF, FF FE or FE FF are labelled immediately, including UTF-32. A file with every byte below 0x80 is plain ASCII and reads the same in every listed encoding. Text in which every other byte is zero is treated as UTF-16 without a BOM, little or big endian depending on which byte is empty. Next the bytes are decoded as strict UTF-8, where any malformed sequence fails the check. Only then is each legacy code page tried with the browser's own TextDecoder, and each result is scored by its share of letters against control characters, replacement characters and words made mostly of accented letters, which is what Cyrillic looks like when it is read as Windows-1252. A single-byte guess is a heuristic, so short files can be ambiguous between Windows-1252 and ISO-8859-15; the override list exists for that. The UTF-8 with BOM option suits CSV files that Excel on Windows otherwise opens with garbled accents.

Targeted Use Cases

  • Fixing a CSV export that shows é instead of é when opened in another program.
  • Converting old Windows-1251 Russian text files to UTF-8 for a website.
  • Adding a UTF-8 BOM so Excel on Windows opens a CSV with the right accents.
  • Changing CRLF line endings to LF before committing scripts to a Git repository.
  • Checking whether a subtitle file is Shift_JIS or UTF-8 before loading it into a player.

Notes & Gotchas

  • Check the preview for names and accented words before downloading, because single-byte guesses can be wrong on short files.
  • Use UTF-8 without BOM for code, web files and anything read by Unix tools.
  • Use UTF-8 with BOM only for CSV files meant for Excel on Windows.
  • Keep the original files until you have opened the converted copies in the program that will use them.

Frequently Asked Questions

How do I convert a file to UTF-8?

Drop the file, confirm the preview reads correctly, leave the output set to UTF-8 and click Download converted file. The download keeps the original file name.

How does it know which encoding a file uses?

It checks for a byte-order mark, then for UTF-16 zero-byte patterns and valid UTF-8. For legacy files it decodes the bytes with each code page and ranks the results by how much of the text comes out as real letters.

Why does my CSV show strange characters in Excel?

Excel on Windows assumes a legacy code page unless a UTF-8 file starts with a BOM. Convert the file to UTF-8 with BOM here and Excel will read accented letters and symbols correctly.

What is the difference between CRLF and LF?

Windows ends each line with a carriage return and line feed, CRLF, while Linux and macOS use only LF. The counts show which style a file uses, and the Line endings menu rewrites them all to one style.

Can it convert files to Windows-1252 or Shift_JIS?

No. It reads all the listed encodings but writes only UTF-8, with or without a BOM, and UTF-16 LE with a BOM, because browsers can only encode text as Unicode.

Related tools

  • File Type Detector (Magic Bytes) - Identify what a file really is from its magic bytes: 80+ formats including Office, EPUB, archives, media, fonts and executables, with MIME type, expected extensions, mismatch warnings and a hex preview.
  • Unicode Character Inspector - Inspect every character: code point, HTML entity, UTF-8 byte size, and script block hints.
  • Hex Dump / Hex Editor - View and edit file bytes as hexadecimal with ASCII sidebar, offset navigation, byte search, and binary diff highlighting.
  • Subtitle Converter & Sync (SRT, VTT, ASS) - Convert subtitles between SRT, WebVTT and ASS, shift timings by milliseconds, change frame rate, sync from two points, merge files, fix overlaps and check reading speed, all in your browser.
  • Screenshot & Image Text Extractor (OCR) - Detect text in screenshots on-device via the browser's Shape Detection API (Chromium). Editable output, copy-ready — no upload, no cloud OCR.
  • Reverse Text Generator - Reverse any text character-by-character. Great for fun, watermarks, or encoding tests.