Encode or decode
Query string parser
| Key | Value |
|---|
Reserved and special characters
| Char | Component | Full URL | Form |
|---|
Percent-encode strings for a URL component, a full URL, or a form, decode them back, and edit a URL's query string as a table.
| Key | Value |
|---|
| Char | Component | Full URL | Form |
|---|
This URL encoder and decoder converts text to percent-encoded form and back. Choose component encoding (encodeURIComponent, for a single query value or path segment), full-URL encoding (encodeURI, which keeps :/?#&= intact), or form encoding (application/x-www-form-urlencoded, where a space becomes +), and decode any of them. A second panel parses a complete URL into its query parameters as an editable table and rebuilds the URL as you change keys and values. A reference table shows how every reserved character is treated by each scheme. It is meant for developers debugging API calls, redirects, tracking links, and OAuth flows, and for anyone who needs to see what a mangled link actually contains.
Component encoding uses the browser's encodeURIComponent, which follows RFC 3986: it leaves A-Z a-z 0-9 - _ . ! ~ * ' ( ) alone and encodes every other character as its UTF-8 bytes in %XX form, so é becomes %C3%A9. Full-URL encoding uses encodeURI, which additionally preserves the reserved delimiters ; , / ? : @ & = + $ #. Form encoding starts from the component result, then also encodes ! ' ( ) ~ and replaces %20 with +, matching what browsers send for a form and what URLSearchParams produces. Decoding reverses the process with decodeURIComponent after optionally turning + into a space, and reports the position of any malformed %-sequence instead of failing silently. The query parser splits the URL at ? and #, then splits the query on & and the first = of each pair.
Use encodeURIComponent for one value that is going inside a URL, such as a query parameter or a path segment, because it encodes &, =, ?, / and # so they cannot be mistaken for delimiters. Use encodeURI only when you have a complete URL that already has its structure and you just need to escape spaces and non-ASCII characters without breaking the delimiters.
Both are valid, but in different places. %20 is the RFC 3986 percent-encoding and works anywhere in a URL. A plus sign means a space only in the query string when the application/x-www-form-urlencoded convention is used, which is what HTML forms submit. In a path, + is a literal plus. When decoding, turn on the + option only for form-encoded query strings.
decodeURIComponent throws when a % is not followed by two hex digits, or when the %XX bytes do not form valid UTF-8, for example a lone %E9 from a Latin-1 encoded page. The tool shows the position of the first bad sequence. Fix that sequence, or if the source is Latin-1, replace %E9 with %C3%A9 and try again.
No. Encoding, decoding, and query parsing run in your browser with the standard JavaScript functions; nothing is posted to a server. The shareable link stores your input in the page's URL fragment, which browsers do not send to servers either, so only paste that link where you are happy for the recipient to see the text.
JSON Formatter · Base64 Encode / Decode · Regex Tester · Hash Generator · UUID Generator · JWT Decoder · HTML Entity Encoder · Color Converter · Password Generator · Number Base Converter · QR Code Generator · Chmod Calculator
Browse all Developer Tools, or go back to every free tool on HeroYears.