UTF-8 vs ASCII, ISO-8859-1, and Windows-1252

Last updated: August 28, 2026.

UTF-8 is the appropriate default for modern web pages because it represents all Unicode characters. ASCII is a compatible subset. ISO-8859-1 and Windows-1252 are older single-byte encodings that are often confused.

Quick comparison

ASCII covers 128 basic characters. ISO-8859-1 defines 256 code positions. Windows-1252 uses printable characters in the 0x80-0x9F range where ISO-8859-1 defines controls. UTF-8 uses one to four bytes and covers all Unicode code points.

EncodingCoverageBest use
ASCIIBasic English and controlsRestricted protocols
ISO-8859-1Legacy Western European setKnown legacy imports
Windows-1252Legacy Windows Western textKnown legacy imports
UTF-8All UnicodeNew pages, APIs, files, and databases

Declare UTF-8 consistently

Save the file as UTF-8 and make the HTTP header, HTML declaration, database connection, and stored data agree. A declaration cannot repair bytes already saved in another encoding.

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>UTF-8 page</title>
</head>
<body>Unicode text belongs here.</body>
</html>

Convert legacy data once

Identify the actual source encoding, keep a backup, and convert at the import boundary. Do not repeatedly guess and reconvert data at display time; that can turn a reversible mismatch into permanent corruption.

Reference: WHATWG Encoding Standard.

admin

admin