- When do I encode a URL?
- When building query strings, path segments, or hash fragments that may contain special characters (&, =, #, space, non-ASCII). Unencoded specials can break URL parsing.
- Which characters need encoding?
- Reserved: `! * ' ( ) ; : @ & = + $ , / ? # [ ]` (only encode in contexts where they're special). Unsafe: space, control chars, non-ASCII. The tool encodes based on the target context.
- What's the difference between encodeURI and encodeURIComponent?
- encodeURI preserves URL structure (leaves /, ?, &). encodeURIComponent is aggressive (escapes them). Use component for query values; use URI for full URLs you want to sanitize without breaking.
- Does it encode `+` for spaces?
- Toggle — for form-encoded values (application/x-www-form-urlencoded) yes. For standard URLs, use `%20`. Default matches the standard.