URL Encoder
Percent-encode and decode text, parse a query string into a readable table, and build a clean query string back from key/value pairs.
Encode / decode
Waiting for input.
Query string → table
Build a query string
About this URL encoder
Percent-encoding replaces characters that are not allowed, or that carry a reserved meaning, with a % followed by the byte's value in hexadecimal. The two functions most people mix up are encodeURIComponent and encodeURI, and the difference is exactly which reserved characters are left alone. encodeURIComponent escapes : / ? # [ ] @ ! $ & ' ( ) * + , ; =, so it is the right choice for a single value you are about to place into a query parameter. encodeURI leaves those characters intact and is meant for encoding an entire URL that is already structurally correct.
Encoding happens on UTF-8 bytes, not on characters. A Chinese character such as 你 occupies three bytes in UTF-8 and therefore becomes three escape sequences — %E4%BD%A0 — and an emoji outside the Basic Multilingual Plane becomes four, %F0%9F%8C%8D for 🌍. This is why a URL containing non-ASCII text gets noticeably longer than the original.
One trap worth knowing: a space is %20 in a path but + in the application/x-www-form-urlencoded format used by HTML form submissions. Both appear in the wild, so the decoder here treats + as a space inside a query string. Also avoid double-encoding — running an already-encoded value through the encoder a second time turns %20 into %2520, which is a common cause of "why does my search box show a percent sign".
Related tools
Found a bug, or need a tool that is not here? Email 2273917172@qq.com — a human reads every message.