Open a text file to detect its character encoding, preview it correctly, and save it again as UTF-8, UTF-16, Windows-1252 or ISO-8859-1 with the line endings you choose. Files never leave your browser.
Last updated:
1. Source
2. Target
Advertisement
Advertisement
How to use the Text Encoding Converter
Open a file (or switch to Paste text). The detected encoding, BOM and line endings appear immediately.
Choose the target encoding, whether to add a BOM and which line endings to use.
Press Convert and review the result. Characters that the target encoding cannot store are listed with their line numbers.
Download the converted file.
How encodings store the same text
The word café uses four characters, but each encoding writes them as different bytes. Only the é changes in the 8-bit encodings; UTF-16 uses two bytes for every character.
Byte order mark. A file starting with EF BB BF is UTF-8, FF FE is UTF-16 LE and FE FF is UTF-16 BE (four-byte marks indicate UTF-32). This is certain.
UTF-16 without a BOM. English or code written in UTF-16 has a zero byte in every other position, which reveals the byte order.
UTF-8 validation. UTF-8 multi-byte sequences follow strict rules. Text with accented letters that passes this check is almost certainly UTF-8, because legacy text rarely forms valid sequences by accident.
Legacy fallback. Anything else is treated as Windows-1252, the most common 8-bit encoding. If the preview shows wrong letters, choose the right code page, such as Windows-1251 for Russian or Windows-1250 for Polish and Czech.
Common conversions
Task
Source
Target settings
Fix accents in an old CSV or subtitle (.srt) file
Windows-1252
UTF-8, no BOM
Make Excel open a CSV with accents correctly
UTF-8
UTF-8 with BOM, CRLF
Remove a BOM that breaks a PHP, JSON or shell file
UTF-8 with BOM
UTF-8, BOM unticked
Read a Windows "Unicode" .txt export
UTF-16 LE
UTF-8, LF
Feed a legacy system that only accepts ANSI
UTF-8
Windows-1252 (check the list of unmappable characters)
Frequently asked questions
How do I convert a file to UTF-8?
Open the file, check that the preview shows the text correctly, choose UTF-8 as the target and press Convert, then Download. If the preview shows odd characters, change the source encoding first, because the conversion can only be as correct as the decoding.
Should I save UTF-8 with or without a BOM?
Without a BOM for almost everything: web pages, source code, JSON, CSV for most tools and Linux or macOS programs. Add a BOM mainly when Microsoft Excel must open a CSV file with accented characters correctly, or for some older Windows programs.
Only when the file has a byte order mark or contains non-ASCII text that is valid UTF-8. Legacy 8-bit encodings such as Windows-1252, Windows-1251 and ISO-8859-2 use the same bytes for different letters, so the tool makes a best guess and lets you pick another encoding if the preview looks wrong.
What is the difference between Windows-1252 and ISO-8859-1?
They are identical except for bytes 0x80 to 0x9F. Windows-1252 uses them for printable characters such as €, curly quotes and the long dash, while ISO-8859-1 reserves them for control codes. Text often labelled ISO-8859-1 is really Windows-1252.
What happens to characters the target encoding cannot store?
Windows-1252 and ISO-8859-1 can store only 256 characters. Anything else, such as emoji, Chinese or Polish letters like ł, is replaced by a question mark, an HTML numeric entity or removed, depending on your choice, and each one is listed so nothing is lost silently. UTF-8 and UTF-16 can store every character.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.