Free Online Utility • UTF-8 Studio • RFC 3629 Engine

Generate Invalid UTF8

Generate official Markus Kuhn & WHATWG invalid UTF-8 byte test vectors: overlong 2/3/4-byte encodings, lone continuations, UTF-16 surrogates, >U+10FFFF, and forbidden bytes.

Reference & UTF-8 Spec RFC 3629
Official WHATWG / Markus Kuhn decoder stress vectors
Every vector MUST be rejected by any compliant RFC 3629 UTF-8 validator!
C0 AFOverlong 2-byte "/"
ED A0 80Forbidden U+D800 surrogate
F4 90 80 80U+110000 (> U+10FFFF)
RFC 3629 INVALID UTF-8 SUITE
Invalid UTF-8 Test Vectors

        
100% client-side RFC 3629 UTF-8 Engine Instant

Session Calculation Log

No entries recorded in this session yet.

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

InputOutputTechnical Note
C0 AFOverlong "/"Must be rejected
ED A0 80Surrogate U+D800Must be rejected
JS Uint8Array ExportReady-to-run Jest/Vitest suite1-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.

Frequently Asked Questions

Why is C0 AF famous in cybersecurity?
In the early 2000s, IIS web servers decoded overlong `C0 AF` as `/` after path-validation filters had already checked for literal `0x2F`, enabling directory traversal attacks.
Can I export these invalid UTF-8 vectors as JavaScript unit tests?
Yes — switch Export Format to JavaScript Uint8Array Test Cases.
Why can bytes 0xFE and 0xFF never appear in valid UTF-8?
RFC 3629 reserves `0xFE` and `0xFF` completely unused — which also makes UTF-16 BOMs (`FE FF` / `FF FE`) instantly distinguishable from UTF-8.