How Generate Invalid UTF8 Works
Generate Invalid UTF8 produces a curated suite of RFC 3629 / Markus Kuhn invalid UTF-8 byte sequences — covering overlong encodings, UTF-16 surrogates, truncated multi-byte sequences, lone continuations, and forbidden `FE`/`FF` octets — exportable as raw hex or JavaScript `Uint8Array` unit tests.
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.
Five Classes of RFC 3629 Violations
1. Unexpected / truncated continuation bytes (80, BF, E2 82) 2. Overlong encodings (C0 AF, E0 80 AF, F0 80 80 AF) 3. Encoded UTF-16 surrogates (ED A0 80 .. ED BF BF) 4. Code points > U+10FFFF (F4 90 80 80) 5. Impossible bytes (C0, C1, F5..FF)
Every compliant UTF-8 parser, web firewall, and database driver should be tested against all five classes to prevent security bypasses and buffer crashes.
Worked Reference Examples
| Input | Output | Technical Note |
|---|---|---|
| C0 AF | Overlong "/" | Must be rejected |
| ED A0 80 | Surrogate U+D800 | Must be rejected |
| JS Uint8Array Export | Ready-to-run Jest/Vitest suite | 1-click copy |
Practical Developer & Systems Workflows
Unit Testing Custom UTF-8 Decoders
Export `INVALID_UTF8_TESTS` straight into Jest, Vitest, Rust, or Go tests.
WAF & Path-Traversal Security Audits
Verify HTTP servers reject overlong `C0 AF` directory separators.
Compatibility, Edge Cases & Best Practices
Paste the Raw Hex Bytes output straight into Validate UTF8 to see every single violation flagged by byte offset.
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.