URL encoder and decoder
Percent-encode or decode URLs with encodeURIComponent or encodeURI, and parse a query string into an editable table of parameters you can rebuild.
- Runs in your browser
- Nothing you enter is sent
- Free, no account
Using encodeURIComponent. Everything except A-Z a-z 0-9 - _ . ! ~ * ’ ( ) is escaped, which is what a single query value needs.
0 characters
How to use this tool
- On the Encode / decode tab, choose a direction and the encoding rule that matches where the value will end up.
- Paste the text. The converted value appears alongside, with a count of how many escape sequences were produced.
- If decoding fails, the message names the exact character position of the broken escape instead of the browser's unhelpful "URI malformed".
- On the Query string tab, paste a full URL to break its parameters into an editable table, then copy the rebuilt URL.
encodeURI or encodeURIComponent?
This is the single most common source of broken links. The two functions differ only in which characters they leave alone.
| Function | Leaves unescaped | Use it for |
|---|---|---|
encodeURI | A-Z a-z 0-9 and ; , / ? : @ & = + $ - _ . ! ~ * ' ( ) # | A complete URL you want to make safe without destroying its structure |
encodeURIComponent | A-Z a-z 0-9 and - _ . ! ~ * ' ( ) | One query value, one path segment, one form field |
| Form encoding | A-Z a-z 0-9 and - _ .; space becomes + | An application/x-www-form-urlencoded body |
The practical rule: build the URL yourself, and run encodeURIComponent on each value you
drop into it. Running encodeURI on a URL that already contains an un-encoded value does
not fix it, because encodeURI deliberately preserves & and
= — the two characters most likely to be inside the value and break the parse.
Common escape sequences
| Character | Escaped | Why it matters |
|---|---|---|
| space | %20 or + | + only means space in a query string, never in a path |
& | %26 | Unescaped, it starts a new parameter |
= | %3D | Unescaped, it splits key from value |
? | %3F | Unescaped, it starts the query string |
# | %23 | Everything after it is a fragment and never reaches the server |
/ | %2F | Escape it inside a path segment that legitimately contains a slash |
% | %25 | A bare percent sign makes the whole URL undecodable |
é | %C3%A9 | Non-ASCII becomes its UTF-8 bytes, two escapes here |
Why decoding sometimes fails
Percent encoding has exactly two rules: a % must be followed by two hexadecimal digits, and
the bytes those escapes produce must form valid UTF-8. Truncating a URL mid-sequence — a very common
result of a database column that is too short, or a log line that has been trimmed — breaks both. The
decoder here reports the position of the first broken escape so you can see immediately whether the
value was cut short or was never encoded properly in the first place.
Editing query parameters
The query-string tab decodes every parameter for display, so you edit readable text rather than escape soup, then re-encodes on the way out. It handles repeated keys (common in filter UIs), parameters with no value, semicolon separators, and preserves the fragment. This is the fastest way to strip UTM parameters, change a page number, or reproduce a bug report's exact query with one value altered.
Nothing leaves your browser
URLs frequently carry session identifiers, signed download links and internal hostnames. All the work here is done by JavaScript in your own tab — there is no server component to log anything.
Questions
What is the difference between encodeURI and encodeURIComponent?
encodeURI keeps the characters that give a URL its structure (: / ? # & =) intact, so it is for encoding a whole URL. encodeURIComponent escapes those too, so it is for a single query value or path segment.
Why does decoding fail with "URI malformed"?
A percent sign must be followed by two hexadecimal digits, and multi-byte UTF-8 sequences must be complete. A bare % or a truncated %E2%82 will throw. The tool reports the offending position instead of a blank output.
Should spaces be %20 or +?
Inside a path, %20. Inside an application/x-www-form-urlencoded query string, + is also accepted for a space. The query-string tab lets you pick which convention to emit.
Can I edit individual query parameters?
Yes. Paste any URL or query string into the query-string tab and every parameter appears as an editable row. Change, add or delete rows and the rebuilt URL updates live with correct encoding.