Two common APIs: component values such as query parameters or path segments, and full URI strings that preserve separators like #, /, and :. All processing runs locally in your browser.
encodeURIComponent / decodeURIComponent:Best for key/value data or a single text segment, for example encodeURIComponent('a=b&c').
encodeURI / decodeURI:Best for a full URL. It does not encode structural characters such as #, ?, /, and :.