Convert Netstring to String
Read length-prefixed netstrings back into text.
What this page computes
Paste one or more netstrings and the page reads each length, takes that many UTF-8 bytes and requires the closing comma, printing the payload text. Several netstrings in a row are decoded in order and the last line counts them.
Where it stops
The length is bytes, not characters, so a netstring carrying an accent or an emoji is measured correctly. A missing colon, a payload shorter than its stated length, a missing comma or a leading character that is not a digit is refused with the byte offset where the shape broke.
Why the answer repeats
Decoding is byte slicing and TextDecoder in this tab, so the same paste always prints the same text and nothing is uploaded.
Decodes one or more length-prefixed netstrings, measuring the stated length in UTF-8 bytes and requiring each trailing comma. Malformed input is refused with the byte offset where the shape broke.
How to use it
Paste the netstring and press Run. Each payload prints on its own line and the last line counts the decoded entries.
The arithmetic
The parser reads ASCII digits, consumes the colon, slices exactly that many bytes and then requires a comma. Bytes rather than characters is what makes multi-byte payloads come out whole.
What to Expect
Best for
- reading a protocol message
- checking a netstring by hand
What this tool keeps
- the decoded payloads and the entry count
Sample input
5:hello,3:bye,
Sample output
hello bye Decoded 2 netstring(s).
Frequently asked questions
How do I use the netstring to string page?
Paste the netstring, then press Run.
Is anything uploaded?
No. The whole calculation runs in this tab with JavaScript: no request is made, no account is needed, nothing is stored, and the page keeps working offline once it has loaded.
What are its limits or bounds?
Each entry must be digits, a colon, exactly that many bytes and a comma. A wrong length or a missing comma must be refused at the byte offset, not silently repaired.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.