UTF-8 vs ASCII: How Encoding Works & How to Fix Garbled Copy-Paste Text
Understand why UTF-8 is backward-compatible with ASCII, why é mojibake happens in Excel/Windows, and how to strip hidden BOM and zero-width characters safely.
ASCII vs UTF-8 in Two Minutes
Original 7-bit ASCII defines just 128 characters (English letters, digits 0–9, and basic punctuation, bytes 0x00–0x7F). UTF-8 preserves every single ASCII byte identically while using 2 to 4 bytes for accented Latin letters, Greek/Cyrillic, CJK characters, and modern emoji—making it the universal encoding for over 98% of websites.
Two Common Encoding Bugs & How to Fix Them
- Mojibake (e.g.,
caféinstead ofcafé): Happens when a UTF-8 file is opened as Windows-1252 / Latin-1 without declaring UTF-8. Always save CSV and HTML files as UTF-8 and inspect raw hex bytes in our Text to Binary & Hex Converter. - Invisible Zero-Width Characters & BOM (
U+FEFF,U+200B): Copying code or CSV headers from PDFs and rich-text docs slips zero-width spaces into strings that break exact comparisons and JSON parsers. Paste suspicious text into our Unicode & Hidden Character Inspector to highlight and strip invisible characters in one click, or escape raw multi-line strings via JSON Escape/Unescape.