Percent-encode text for use as a URL component, or decode a percent-encoded component back to text.
How to encode or decode a component
- Enter one query value or path segment.
- Choose Encode Component for plain text, or Decode Component for percent-encoded text.
- Review the result and select Copy Result.
Editing the input clears the old result. Copy becomes available after a successful conversion; it never chooses a conversion mode for you. Empty input produces an empty result. The limit is 50,000 JavaScript string units.
What encoding mode is used?
Encode uses JavaScript encodeURIComponent(), which is intended for a URL component such as a query value or path segment—not for blindly encoding an entire already-structured URL.
HTML form encoding commonly represents spaces as +. encodeURIComponent() represents spaces as %20. Use the format required by the system you are sending data to.
Examples and common mistakes
hello world encodes as hello%20world. The query value A&B becomes A%26B, so the ampersand stays part of the value instead of separating query parameters. A literal plus sign becomes %2B.
Does decoding turn plus signs into spaces?
No. a+b decodes to a+b. This is component decoding, not an HTML form parser. Use a form-aware parser when your input represents form-encoded data.
Why does decoding show an error?
A percent escape needs two hexadecimal digits, and encoded byte sequences must represent valid UTF-8. A lone %, %ZZ, or incomplete multibyte sequence is rejected. Decoding does not verify that a URL is safe to visit.
Should I encode an already encoded value?
Only if the receiving system requires another encoding layer. Encoding %20 gives %2520 because the percent sign is encoded again. For JavaScript behavior and exceptions, see MDN’s encodeURIComponent reference.