← Text & List Tools
Text & List Tools · runs locally

Netstring Text Encoder and Decoder

Frame one UTF-8 value as length:data, or decode a strict netstring whose declared byte length matches exactly.

Ready. Your working data stays in this browser.

Why this tool is useful

Use netstrings for simple length-prefixed protocol examples where delimiters may appear inside the payload and byte boundaries must remain unambiguous.

How it works

The browser counts UTF-8 bytes rather than characters, writes a decimal length and verifies the colon, comma and exact byte boundary during decoding.

Practical example

Hello becomes 5:Hello, while the Unicode value Привет uses its 12-byte UTF-8 length rather than six visible letters.

Validation

The calculation is deterministic and explains validation errors instead of silently changing invalid input.

Privacy boundary

Input and output remain in this tab. Copy and download happen through browser APIs without a server upload.

Result passport

Every run reports its tool mode, timestamp and input/output size so transformed data can be audited.