Encode or decode URL strings instantly. Choose between component encoding (query values) or full-URL encoding — all in your browser.
URL encoding (also called percent encoding) converts characters that are not allowed in URLs into a %XX format, where XX is the hexadecimal byte value. For example, a space becomes %20 and an ampersand becomes %26.
JavaScript (and this tool) provides two encoding modes that differ in which characters they preserve:
encodeURIComponent — Encodes everything except letters, digits, and - _ . ! ~ * ' ( ). Use this when encoding a single query parameter value or path segment. It encodes /, ?, =, &, and #.encodeURI — Designed for full URLs. It preserves characters that are meaningful in a URL structure (:, /, ?, #, &, =). Use this only when encoding a complete URL.encodeURIComponent on each key and value, then join with &.encodeURIComponent so the inner URL doesn't break the outer URL's structure.encodeURI to make it safe while keeping it readable.Input: Hello World & more=stuff
encodeURIComponent: Hello%20World%20%26%20more%3Dstuff
encodeURI: Hello%20World%20&%20more=stuff
Notice how encodeURI preserves = and & because they are meaningful URL characters, while encodeURIComponent encodes them.