Encode or decode URL components and query strings.
URLs can only contain a specific set of ASCII characters. Spaces, ampersands, equals signs, and other special characters must be replaced with a percent-encoded equivalent — for example, a space becomes %20, and & becomes %26. Your browser does this automatically when you type a URL, but when you are building URLs in code, working with API parameters, or debugging a redirect URL that looks garbled, you need to do it manually.
Encode the query value: hello world & more=yes
Encoded: hello%20world%20%26%20more%3Dyes Safe to use in a URL like: https://example.com/search?q=hello%20world%20%26%20more%3Dyes