UTF-8 Converter
Convert a local UTF-8, UTF-16LE, UTF-16BE or Windows-1252 text file into validated UTF-8 bytes and download the result.
Privacy: your files never leave your device. All processing happens locally in your browser.
How to use
- 1.Determine and select the file's real source encoding instead of guessing from its appearance.
- 2.Choose a text file up to 10 MB, convert it and inspect non-ASCII characters in the preview.
- 3.Download the UTF-8 file, test it in the destination application and retain the original until verified.
About UTF-8 Converter
UTF-8 Converter changes a local text file from a selected source encoding into standard UTF-8. It supports UTF-8 validation and BOM removal, UTF-16 little-endian, UTF-16 big-endian and Windows-1252. The browser reads the file, previews decoded text and creates a downloadable UTF-8 file without uploading source bytes.
This tool does not guess an encoding. You must select the encoding that actually produced the file. Byte sequences can be valid under more than one legacy encoding while representing different characters, so an automatic guess can look plausible and still corrupt names, punctuation or symbols. Explicit selection keeps the transformation auditable.
UTF-8 mode validates the source with fatal error handling. Invalid continuation bytes, truncated sequences and forbidden encodings cause a clear failure rather than replacement characters. A leading UTF-8 byte-order mark is consumed by the standards-based decoder, and the downloaded result is emitted by the UTF-8 encoder without adding a BOM.
UTF-16LE and UTF-16BE modes differ in byte order. The letters in a file can become nonsense if endian order is reversed even though pairs of bytes remain readable. Select little-endian for formats that store the low byte first and big-endian for formats that store the high byte first. A matching BOM is recognized and removed.
Supplementary characters such as emoji use UTF-16 surrogate pairs. The decoder combines a valid high and low surrogate into one Unicode scalar value before UTF-8 output. Unpaired or malformed sequences are rejected under fatal decoding. This prevents silently exporting replacement diamonds while claiming a successful conversion.
Windows-1252 is the common Western legacy code page often mislabeled ISO-8859-1. Bytes 80 through 9F include printable punctuation and symbols such as the euro sign and curly quotation marks. The browser's standards-defined Windows-1252 decoder supplies those mappings before UTF-8 re-encoding.
The output represents decoded characters, not a byte-for-byte copy. A Windows-1252 euro byte 80 becomes the three UTF-8 bytes E2 82 AC. The page reports source and output byte counts so expansion or contraction is visible. Different counts are expected and do not by themselves indicate data loss.
Files are limited to 10 MB because the browser File and Encoding interfaces operate on an in-memory buffer here. The size is checked before reading to avoid loading an unexpectedly large file. For database dumps or multi-gigabyte logs, use a trusted streaming conversion utility with explicit source and destination encodings.
The preview helps catch an obviously wrong selection before download, but it may not display every control character or normalization difference. Inspect representative names, punctuation, currency symbols and non-ASCII lines. If the source contains mixed encodings in one file, a single decoder cannot repair it reliably.
Changing the file or source encoding cancels the visible result and invalidates the prior download URL. A job identity prevents a slower old file read from replacing a newer choice, and obsolete object URLs are revoked. The downloaded filename adds -utf8 and uses a plain-text UTF-8 media type.
Eight external fixtures cover ASCII UTF-8, multibyte UTF-8, UTF-8 BOM handling, both UTF-16 byte orders with emoji, both UTF-16 BOMs and Windows-1252 punctuation. Tests compare exact decoded text and exact re-encoded UTF-8 bytes, while malformed UTF-8 must fail.
Use the converter by identifying the source encoding from the producing application or reliable metadata, selecting the file, converting and reviewing the preview. Download the result, then test it in the destination application before replacing any original. Keep the original file until the complete workflow is verified.
This page is distinct from a text-to-UTF-8-byte viewer: it handles real file bytes, selected legacy encodings and a downloadable artifact. It does not detect encodings, repair mojibake heuristically, normalize Unicode, translate languages or modify line endings beyond what follows from decoding and UTF-8 encoding.
Methodology & sources
The selected bytes are decoded with the WHATWG label and fatal error handling, then re-encoded using the browser UTF-8 encoder. Source size is checked before reading; output has no added BOM and is exposed through a revocable local Blob URL.
Frequently asked questions
Related tools
- UTF-8 Encoder / DecoderConvert Unicode text to well-formed UTF-8 bytes or strictly decode byte sequences without silent replacement.
- Unicode Encoder / DecoderConvert text to explicit Unicode code points or rebuild text from U+ and JavaScript-style scalar notation without splitting supplementary characters.
- Text To HEXEncode text into exact UTF-8 hexadecimal with continuous, spaced, or 0x-prefixed output and explicit Unicode replacement warnings.
- File to Base64 ConverterEncode a local file up to 10 MB as canonical Base64 or decode strict Base64 into a downloadable file without uploading bytes.
- A1Z26 Cipher TranslatorTranslate English letters to the explicit A=1 through Z=26 puzzle format and decode validated number groups without ambiguous word boundaries.
- AES Encryption OnlineEncrypt text into a portable authenticated AES-256-GCM JSON package or decrypt a package with its password entirely in your browser.