How Convert UTF8 to UTF-2 Works
Convert UTF8 to UTF-2 encodes modern UTF-8 text (and optional 31-bit UCS-4 scalars up to U+7FFFFFFF) into Plan 9 UTF-2 (1992) byte sequences.
UTF-8 (RFC 3629) is the dominant variable-width character encoding of the web, representing every Unicode scalar value from U+0000 to U+10FFFF in 1 to 4 self-synchronizing bytes while remaining 100% backward-compatible with 7-bit ASCII. Every conversion and analysis in this tool executes locally inside your browser with zero server uploads, preserving full privacy and instant response times.
UTF-2 1–6 Byte Prefix Grammar
1B: 0xxxxxxx (7 bits) 2B: 110xxxxx 10xxxxxx (11 bits) 3B: 1110xxxx 10xxxxxx×2 (16 bits) 4B: 11110xxx 10xxxxxx×3 (21 bits) 5B: 111110xx 10xxxxxx×4 (26 bits) 6B: 1111110x 10xxxxxx×5 (31 bits)
UTF-2 was Ken Thompson & Rob Pike’s 1992 Plan 9 predecessor to UTF-8 — identical bit prefixes across 1–4 bytes and extending to 5–6 bytes for full 31-bit UCS-4!
Worked Reference Examples
| Input | Output | Technical Note |
|---|---|---|
| Hello Café 🌍 | 48 65 6C 6C 6F 20 43 61 66 C3 A9 20 F0 9F 8C 8D | Identical to modern UTF-8 |
| U+00200000 (UCS-4) | F8 88 80 80 80 | 5-byte historical form |
| U+7FFFFFFF (UCS-4) | FD BF BF BF BF BF | Max 6-byte 31-bit scalar |
Practical Developer & Systems Workflows
Systems & Encoding History
Explore the exact 1992 UTF-2 encoding that became RFC 3629 UTF-8.
Testing Legacy 5/6-Byte Decoders
Generate valid 5- and 6-byte UCS-4 sequences to test RFC 3629 strictness.
Compatibility, Edge Cases & Best Practices
RFC 3629 (2003) formally restricted UTF-8 to 1–4 bytes (U+10FFFF) to guarantee 1:1 equivalence with UTF-16.
Copy verified outputs directly to your clipboard or export clean UTF-8 files ready for source repositories, REST APIs, database migrations, protocol test suites, and systems debugging.