Encode and decode URLs, handling special characters and Unicode properly.
%20
Space character
%3F
Question mark (?)
%26
Ampersand (&)
%3D
Equals sign (=)
%2B
Plus sign (+)
%23
Hash symbol (#)
Encode special characters in URL query strings
name=John%20Doe&city=New%20York
Encode form field values before submission
email=user%40example.com
Encode parameters in API endpoint URLs
/api/search?q=hello%20world
Encodes entire URI, preserving characters like :, /, ?, #
encodeURI("http://example.com/path with spaces?query=value")
Result: http://example.com/path%20with%20spaces?query=value
Encodes URI components, including :, /, ?, #
encodeURIComponent("hello world?")
Result: hello%20world%3F