Unicode and ASCII codes
Unicode and ASCII: The Shared Range
Unicode was designed to extend far beyond ASCII, but it does so without breaking any existing ASCII data. The first 128 code points of Unicode - from U+0000 to U+007F - are identical to ASCII codes 0 to 127. Every character that exists in ASCII has exactly the same numerical code in Unicode. This is not a coincidence; it was a deliberate design decision made when Unicode was created.
This means that any text file or data stream that was encoded using ASCII is automatically valid Unicode. A Unicode system receiving ASCII-encoded text will read and display every character correctly, without any conversion or translation step being required.
Selected Characters: ASCII Code vs Unicode Code Point
| Character | ASCII Decimal Code | Unicode Code Point | Same value? |
|---|---|---|---|
| Space | 32 | U+0020 | Yes |
| 0 (digit) | 48 | U+0030 | Yes |
| A | 65 | U+0041 | Yes |
| a | 97 | U+0061 | Yes |
The hexadecimal values in the Unicode column confirm the match. For example, U+0041 in hexadecimal equals 65 in decimal - identical to the ASCII code for the letter "A". This pattern holds for all 128 characters in the shared range.
Key Takeaways
- Unicode code points 0 to 127 (U+
0000to U+007F) are identical to ASCII codes 0 to 127. - This shared range was a deliberate design decision, ensuring that Unicode could be adopted without making existing ASCII data invalid.
- Any text encoded in ASCII is automatically valid Unicode - no conversion is needed for characters in the 0-127 range.
- Characters beyond code 127 exist only in Unicode; they have no equivalent in the original 7-bit ASCII standard.