String Encoders

~/tools/encoders $ ./transform
input.txt
output.txt

String Encoders

Web systems encode text so binary-safe transport and HTML escaping behave predictably. Use this helper to move between plain text, Base64, percent-encoded URLs, and HTML entities when debugging form posts, emails, or legacy integrations.

How to use

  1. Choose the source format (for example raw text or Base64) based on what you copied from logs or DevTools.
  2. Paste the string and run encode or decode toward your target format.
  3. Confirm the output matches the consumer’s expectations (e.g., `+` vs `%20`, line wraps in Base64) before embedding it in URLs or markup.

FAQ

Why does my Base64 decode to garbled bytes?
The input may be URL-safe Base64, truncated padding, or not Base64 at all—verify charset (UTF-8 vs Latin-1) and whether the payload is hex instead.
When should I use encodeURIComponent?
For query parameter values and path segments in URLs; it escapes reserved characters per UTF-8 bytes. Do not encode the whole URL twice.
Are HTML entities enough to stop XSS?
Context matters—escape for HTML text nodes differs from attributes and URLs. Prefer framework auto-escaping and Content-Security-Policy rather than encoding alone.