# Text Encoding Forensics and Repair

Inspect text encoding, BOM, newline style and mojibake symptoms, then produce a scored local repair candidate.

> Canonical page: https://elysiatools.com/en/tools/text-encoding-forensics-and-repair

- **Category:** Text Processing

- **Keywords:** encoding forensics, mojibake repair, UTF-8, GBK, BOM

## Overview

Text Encoding Forensics and Repair inspects pasted text or supported text files for encoding issues, BOM markers, newline styles, and mojibake symptoms, then returns a JSON result with a local repair candidate and diagnostics.

## Inputs

- **Text Content** (textarea): Paste text or mojibake here...
- **Upload Text File** (file)
- **Source Encoding** (select)
- **Repair Mode** (select)
- **Newline Output** (select)
- **Remove BOM** (checkbox)

## When to use

- Repair UTF-8 mojibake such as "CafÃ©" when the original text was decoded incorrectly.
- Detect and normalize BOM markers and line endings in text, CSV, JSON, or Markdown files.
- Check an unknown text encoding before choosing UTF-8, UTF-16, GB18030, Windows-1252, or ISO-8859-1.

## How it works

- Paste text into the input or upload a supported text, CSV, JSON, or Markdown file.
- Choose automatic detection or specify the source encoding.
- Select automatic mojibake repair, BOM and newline normalization, or text preservation.
- Review the JSON output, including repaired text and encoding, BOM, newline, or mojibake diagnostics when available.

## Use cases

- Recover readable accented characters from incorrectly decoded UTF-8 text.
- Standardize mixed text files by removing a BOM and converting Windows CRLF endings to Unix LF.
- Inspect imported data before saving or passing it to another text-processing workflow.

## Frequently asked questions

### What input can I use?

You can paste text or upload one text/plain, text/csv, application/json, or text/markdown file up to 10 MB.

### Which encodings are supported?

The tool supports automatic detection, UTF-8, UTF-16LE, UTF-16BE, GB18030/GBK, Windows-1252, and ISO-8859-1.

### Can it repair mojibake?

Yes. Automatic Mojibake Repair scores a local reversible repair candidate and returns the best result.

### Can I change line endings?

Yes. You can preserve the original style or output LF or CRLF line endings.

### Can I remove a BOM?

Yes. Enable Remove BOM to remove a leading BOM and report whether it was removed.

## Related tools

- [AI Token Estimator](https://elysiatools.com/en/tools/ai-token-estimator): Analyze language mix and estimate token usage across OpenAI, Codex, Claude, and DeepSeek profiles
- [BOM Character Remover](https://elysiatools.com/en/tools/data-bom-remover): Remove BOM (Byte Order Mark) characters from text and file content. Perfect for cleaning up text files that have encoding issues, fixing CSV imports, and preparing data for processing. Features: - Detect and remove UTF-8 BOM (EF BB BF) - Detect and remove UTF-16 BOM (FE FF or FF FE) - Detect and remove UTF-32 BOM (00 00 FE FF or FF FE 00 00) - Support multiple input formats - Visual BOM character display - Detailed detection report - Support for batch text processing Common Use Cases: - Fix CSV file import errors - Clean up text file encoding issues - Prepare data for JSON parsing - Fix XML parsing problems - Resolve API data encoding conflicts - Standardize text data format
- [Messy Text to Structured Data Workbench](https://elysiatools.com/en/tools/messy-text-to-structured-data-workbench): Infer tables from pasted text, mixed delimiters, key-value lines, or HTML and export CSV, JSON, and Markdown.
- [TXT File Merger](https://elysiatools.com/en/tools/txt-merger): Merge multiple text files with various strategies (concatenate, interleave, etc.)
- [Data Range Limiter](https://elysiatools.com/en/tools/data-range-limiter): Limit numerical values to specified ranges by clipping, filtering, or marking out-of-bounds values. Perfect for data quality control, sensor data cleaning, business rule enforcement, and data preprocessing. Features: - Range clipping (clip values to min/max boundaries) - Range filtering (remove out-of-bounds rows) - Range marking (flag modified values) - Per-column range configuration - Automatic numeric column detection - Multiple handling strategies - Detailed modification reports - Statistical analysis of changes - Business rule enforcement Common Use Cases: - Sensor data validation and cleaning - Machine learning input preparation - Data quality control and validation - Business constraint enforcement - Outlier management and control - Data preprocessing pipelines
- [Time Series Forecast & Seasonality Analyzer](https://elysiatools.com/en/tools/time-series-forecast-seasonality-analyzer): Forecast future periods from CSV or JSON time-series data and inspect trend, seasonal, and residual decomposition in one report
- [CSV Transformer](https://elysiatools.com/en/tools/csv-transformer): Transform and process CSV data with column operations, calculations, and data type conversions. Supports renaming columns, adding calculated columns, removing columns, converting data types, calculating values, and filtering rows. Operation examples: • Rename column: \[{"type": "rename", "column": "old_name", "new_name": "new_name"}\] • Add calculated column: \[{"type": "add_column", "new_column": "total", "formula": "price * quantity"}\] • Remove column: \[{"type": "remove_column", "remove_column": "column_to_remove"}\] • Convert data type: \[{"type": "convert_type", "convert_column": "age", "target_type": "number"}\] • Calculate values: \[{"type": "calculate", "target_column": "total", "expression": "price * tax + shipping"}\] • Filter rows: \[{"type": "filter_values", "filter_column": "status", "operator": "equals", "value": "active"}\]
- [CSV Data Grouper](https://elysiatools.com/en/tools/csv-data-grouper): Group CSV data by specified columns with aggregation options. Perfect for summarizing and analyzing large datasets by categories, dates, or other criteria.

## Samples

- [PDF Samples](https://elysiatools.com/en/samples/pdf-samples): Generated PDF samples from tools dated 2026-02-01 to 2026-02-10
- [CSV Samples](https://elysiatools.com/en/samples/csv-samples): Sample CSV files with various data types, sizes, and complexity levels
- [Python Samples](https://elysiatools.com/en/samples/python): Essential Python code examples and Hello World demonstrations
- [Hex/Unicode Encoding Format Samples](https://elysiatools.com/en/samples/text-hex-unicode-formats): Examples of hex (\xXX) and unicode (\uXXXX) escape sequence encoding formats
