Skip to content
Tesserae

Keyboard shortcuts

Focus search
/
This help dialog
?
Run the current tool
Ctrl/⌘ +Enter
Copy the output (when an output is focused)
Ctrl/⌘ +C

Shortcuts are ignored while you are typing in an input, a textarea or a select.

Web & CSS

Content-Length & Body Byte Counter

Compute the exact UTF-8 byte length of pasted HTTP body content, report the JavaScript string length, flag the character-vs-byte mismatch, and verify a declared Content-Length header value. All computation happens locally.

On-device No network Offline-ready

🔒 100% Client-Side & Private — processed locally in your browser. Files never leave your device.

Try:

Options

Your result will appear here

Type or paste your input above, adjust the options, then press Run. Tip: press Ctrl+Enter to run, and ? for every shortcut.

How it works

Counting the bytes of a body

Paste a request or response body and the tool reports its exact UTF-8 byte length, the JavaScript string length, the line count and the average bytes per character. Because UTF-16 string length and UTF-8 byte length disagree for any non-ASCII text, the mismatch line shows precisely where a declared Content-Length would go wrong.

Fix the header that truncates requests

A body containing an accent, a currency sign or an emoji is longer in bytes than in characters, so a Content-Length copied from a character count is too small and the request is cut in half. Pasting the body here gives the number that actually belongs in the header and proves the difference.

Analyze versus verify

Analyze mode breaks the body down and reports the size table. Verify mode takes a declared Content-Length and compares it with the measured bytes, reporting a match, or the exact byte difference in either direction. Both modes normalise CRLF line endings to LF before counting.

What it does not cover

Only bodies that declare a length can be checked, so chunked transfer encoding is out of scope. A declared value must be a non-negative integer or the tool says so instead of guessing. The measurement is UTF-8 by definition, so a body in another encoding needs converting first.

Measured in your browser

Encoding and counting use the page, not a server, so the body never leaves your device. It works offline, and a body containing tokens or personal data is measured without being transmitted anywhere.

Questions

Why does byte length differ from string length?

JavaScript strings count UTF-16 code units, so non-ASCII characters (é, emoji) use multiple bytes in UTF-8.

When does Content-Length matter?

A wrong Content-Length wrong corrupts HTTP/1.1 bodies; mismatches can cause truncation or desync. 2 bytes per multibyte character is a common source.

What about chunked?

Chunked transfer encoding omits Content-Length; this tool is for bodies that declare a length.

See category