Which variant when
- encodeURIComponent: building a query string.
?q=${encodeURIComponent(value)} - encodeURI: cleaning up an entire URL that may contain spaces or non-ASCII path segments.
- form-urlencoded: matching what HTML forms send, often what backends decode.
FAQ
- Difference between the three variants?
encodeURIComponentescapes everything that's not a safe component character — use it for query values.encodeURIleaves URI structural chars (:/?#) intact — use for whole URIs. Form-urlencoded turns spaces into+instead of%20— what HTML forms send.- Why does <code>+</code> sometimes mean space?
- Form-urlencoded encoding (used by HTML
- How do I encode a full URL safely?
- Encode each query value with
encodeURIComponentseparately, then assemble. Don't encode the whole URL — that breaks the structural slashes.
Related tools
- Base64 Encode / Decode
UTF-8 safe encode and decode that round-trips emoji, CJK, and URL-safe variants.
- UUID Generator (v4 / v7)
Generate UUID v4 (random) or v7 (time-ordered). Bulk regenerate up to 100 at once.
- Unix Timestamp Converter
Convert between unix timestamps (seconds or ms) and human dates (ISO, RFC, local).
- JWT Decoder
Decode JWT header and payload, see expiration status. No signature verification.