What Is This Tool?
URL encoding (percent encoding) replaces characters that aren't allowed in URLs with a % followed by their byte value in hex — a space becomes %20, and 你 becomes %E4%BD%A0. Without it, characters like spaces, &, ? and non-ASCII text would break the URL structure or get misinterpreted by servers.
There are two common needs, and this tool supports both: encoding a value that goes inside a query parameter (component mode — encodes / ? & = too), and encoding a whole URL while keeping its structure (full-URL mode — leaves :// ? & intact).
Why Use It?
- Build query strings safely — user input with &, = or spaces won't break your URL.
- Decode long encoded URLs from logs, analytics or redirect chains to see what they actually say.
- Correct UTF-8 handling for Chinese, emoji and other non-ASCII text.
- Two modes so you don't accidentally encode the : and / of an entire URL.
- Free, instant, no upload.
How to Use
- Paste your text or URL into the input box.
- Pick the mode: "Component" for values going into query parameters, "Full URL" for entire URLs.
- Click "Encode" or "Decode".
- Copy the result.
Example
Input
https://example.com/search?q=hello world & 你好Output
Component mode: https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dhello%20world%20%26%20%E4%BD%A0%E5%A5%BD
Full URL mode: https://example.com/search?q=hello%20world%20&%20%E4%BD%A0%E5%A5%BDComponent mode encodes structure characters too; full-URL mode preserves them.
Frequently Asked Questions
When should I use component mode vs full URL mode?
Component mode (encodeURIComponent) when encoding a single value that goes inside a query parameter — it encodes /, ?, & and = so they can't break the URL. Full URL mode (encodeURI) when encoding a complete URL — it keeps the structural characters so the URL still works.
Why did %20 appear instead of + for spaces?
Both are valid in different contexts. %20 is the universal percent-encoding for a space; + means space only inside query strings using the older application/x-www-form-urlencoded format. This tool uses %20, which works everywhere.
Why does decoding fail with an error?
The input contains a malformed percent sequence, like a % not followed by two hex digits. This often happens when a URL was cut off or double-decoded. Fix or remove the broken % sequence.
What is double encoding?
Encoding already-encoded text: %20 becomes %2520 because % itself is encoded to %25. It's a common bug — if your decoded output still contains % codes, decode it once more.
Does this handle Chinese characters and emoji?
Yes. Text is encoded as UTF-8 bytes, so 你好 becomes %E4%BD%A0%E5%A5%BD and decodes back perfectly — the same behavior browsers use.