URL encoder / decoder
Percent-encode a query value or a full URL, or decode percent sequences back to text.
Handy when a search string, redirect, or webhook payload keeps breaking on spaces, ampersands, or Unicode.
Client-side only. Uses the browser encodeURI / encodeURIComponent APIs. Nothing is uploaded.
A query string that breaks without encoding
Say you want q=nails & tips as a search value. If you paste that raw into a URL, the & starts a new parameter and the space splits the request. Component mode turns the value into something a parser can treat as one field:
| Piece | Raw | Component-encoded |
|---|---|---|
| Space | (U+0020) | %20 |
| Ampersand | & | %26 |
| Equals | = | %3D |
| Accented e | é | %C3%A9 (UTF-8) |
| Flower emoji | 🌸 | %F0%9F%8C%B8 |
Build the URL as ?q= plus the encoded value, not by encoding the whole ?q=... string in component mode (that would encode the ? and = too).
Component vs full URL
Component matches encodeURIComponent / decodeURIComponent. Use it for one value you will drop into a query string, path segment, or header that expects a single token.
Full URL matches encodeURI / decodeURI. It escapes spaces and non-ASCII characters but leaves structural characters alone: :/?#[]@!$&'()*+,;=. Reach for it when the input is already shaped like https://example.com/path?x=1 and you only need the unsafe bits percent-encoded.
Wrong scope is a common bug: full-URL encode on a lonely a&b leaves the & untouched, which is usually not what you wanted for a query value.
Spaces, plus signs, and form bodies
This tool follows the JavaScript URL APIs: spaces become %20, and + stays +. HTML form encoding (application/x-www-form-urlencoded) historically used + for spaces. If you are talking to an API that still expects that dialect, encode with component mode, then replace %20 with + for that hop only. Decode the other way: turn + into a space before decodeURIComponent when the peer used form encoding.
What this page will not do
- Upload or log your string (no server round-trip).
- Parse or rebuild a full URL object graph. For query editing beyond encode/decode, use a dedicated URL builder.
- Base64 or JWT work. For payloads in Base64 see the Base64 encoder; for HS256 tokens see the JWT encoder.
- Guess which dialect a remote API wants. Check the docs for
%20vs+and for whether reserved characters should stay literal.
FAQ
Does this URL encoder upload my text?
No. Encoding and decoding run in JavaScript on this page. ToolPetal has no backend for URL conversion.
When should I use component mode vs full URL mode?
Use component mode (encodeURIComponent) for a single query value, path segment, or form field so characters like &, =, ?, and / become percent-encoded. Use full URL mode (encodeURI) when you already have a complete URL and only need spaces and non-ASCII characters escaped while leaving :/?&=# intact.
Why does a plus sign stay as + after encode?
JavaScript encodeURIComponent leaves + alone and turns spaces into %20. Older application/x-www-form-urlencoded forms often used + for spaces. If a server expects +, replace %20 with + after encoding, or encode a space as + yourself for that API.
What happens on invalid percent sequences?
Decode throws when a % is not followed by two hex digits, or when the bytes are not valid UTF-8. This page shows the error instead of inventing a string.