ASCII to ANSI Converter
Convert ASCII text to ANSI encoding (Windows code pages CP1250-CP1258). View hex, decimal, binary output and download encoded files.
About
ASCII defines 128 characters (code points 0 - 127). ANSI extends this to 256 characters using Windows code pages, where bytes 128 - 255 map to locale-specific glyphs. Confusing code pages corrupts text irreversibly. A file saved as CP1252 (Western European) and opened as CP1251 (Cyrillic) produces garbled output known as mojibake. This tool performs real byte-level encoding using complete lookup tables for each Windows code page. It does not guess. It maps every character deterministically and flags anything outside the target code pageβs repertoire.
The converter accepts plain text or uploaded files and produces the exact byte sequence a Windows application would generate for the selected code page. Output is available as hexadecimal, decimal, or binary representation. You can download the raw encoded binary file for integration testing, protocol debugging, or legacy system interoperability. Note: ASCII characters (0 - 127) are identical across all ANSI code pages. Divergence occurs only in the upper half (128 - 255).
Formulas
The encoding process maps each Unicode code point to a single byte in the target ANSI code page.
Where c is the Unicode code point of the input character, Tcp is the lookup table for code page cp, and 0x3F is the byte for the replacement character "?". The hex representation converts each byte b to a two-digit hexadecimal string via b.toString(16).padStart(2, "0"). Binary output uses b.toString(2).padStart(8, "0").
Reference Data
| Code Page | Name | Region / Language | Unique Range | Notable Characters |
|---|---|---|---|---|
| CP1250 | Windows-1250 | Central European | 128 - 255 | Ε , Ε‘, Ž, ž, Ε, Δ |
| CP1251 | Windows-1251 | Cyrillic | 128 - 255 | Π - Π―, Π° - Ρ, Π, Ρ |
| CP1252 | Windows-1252 | Western European | 128 - 255 | β¬, Γ, ΓΆ, Γ±, Γ§ |
| CP1253 | Windows-1253 | Greek | 128 - 255 | Ξ - Ξ©, Ξ± - Ο |
| CP1254 | Windows-1254 | Turkish | 128 - 255 | Ε, Δ, Δ°, Δ±, Γ§ |
| CP1255 | Windows-1255 | Hebrew | 128 - 255 | Χ - Χͺ, niqqud marks |
| CP1256 | Windows-1256 | Arabic | 128 - 255 | Arabic letters, β, β |
| CP1257 | Windows-1257 | Baltic | 128 - 255 | Δ, Δ, Δ, Δ£, Δ·, ΔΌ, Ε |
| CP1258 | Windows-1258 | Vietnamese | 128 - 255 | Ζ‘, Ζ°, combining tones |
| CP874 | Windows-874 | Thai | 128 - 255 | Thai consonants, vowels, tones |
| ASCII | US-ASCII | Universal | 0 - 127 | Control chars, printable Latin |
| Bytes 0x00 - 0x7F are shared across all code pages. Bytes 0x80 - 0x9F in CP1252 contain printable characters (e.g., β¬ at 0x80) where ISO-8859-1 has control codes. | ||||