Percent-encoding is byte-oriented: a Unicode character is first represented as UTF-8 bytes, then bytes that cannot appear directly in a given URI context are written as %HH. That is why a byte counter is more informative than a character counter when you are debugging non-ASCII URLs.
Component mode vs full-URI mode
Z Tools exposes the browser-native distinction instead of inventing a custom encoder. encodeURIComponent is usually the right primitive for a query value or path segment because it escapes characters that could be interpreted as separators. encodeURI preserves structural URI characters such as :, /, ?, #, and several delimiter characters so an already assembled URL keeps its structure.
A concrete failure mode
Suppose the query value is red & blue. Passing it through encodeURI can leave the ampersand structural, so concatenating it into ?color=... risks creating a second parameter. Encoding the value as a component produces a representation where the ampersand cannot be misread as a separator.
Unicode becomes multiple percent triplets
An em dash U+2014 is UTF-8 bytes E2 80 94, so it appears as %E2%80%94 when escaped. Emoji commonly occupy four UTF-8 bytes. The updated tool shows input UTF-8 bytes and encoded output bytes, plus the size change, so this expansion is visible rather than abstract.
Malformed input should fail loudly
decodeURIComponent rejects incomplete or invalid percent sequences. Z Tools surfaces that error instead of returning partially decoded text. Double-encoding is different: %2520 is syntactically valid and decodes once to %20; whether a second decode is appropriate depends on the upstream system.
Form encoding is related but different
application/x-www-form-urlencoded commonly represents spaces as +. For complete parameter construction, URLSearchParams is less error-prone than manually concatenating encoded pieces.
Primary reference
The generic URI syntax and percent-encoding rules are specified by RFC 3986. JavaScript’s exact escaped-character sets come from ECMAScript web behavior, so test against the runtime you deploy when compatibility matters.