URL Encoder & Decoder — Fix Percent-Encoding Errors
September 5, 2026
Written by Mohammad Sohail
URL encoding (percent-encoding) converts special characters into a format that can be safely transmitted over the internet. Spaces become %20, Chinese characters become %E4%BD%A0%E5%A5%BD, and symbols like @ become %40. Every web developer needs this daily.
When URL Encoding Is Required
Sending query parameters with special characters (search terms with spaces, symbols, non-ASCII text). Encoding form data before POST requests. Building API URLs with user-provided values. Encoding redirect URLs. Working with internationalized domain names.
Common Encodings
Space → %20 or + (in query strings). @ → %40. / → %2F. & → %26 (this is a query delimiter, so it must be encoded in values). = → %3D. # → %23 (this is a fragment delimiter). Chinese '你好' → %E4%BD%A0%E5%A5%BD. Emoji '😊' → %F0%9F%98%8A.
What I Tested
I used the URL Encoder/Decoder with several inputs.
• 'hello world' → 'hello%20world'. Correct.
• 'https://example.com/path?q=test&page=1' → All special characters encoded correctly. The encoded version preserves the URL structure while encoding the values.
• 'user@example.com' → 'user%40example.com'. Correct.
• '%E4%BD%A0%E5%A5%BD' (decoded) → '你好'. Correct round-trip.
Step-by-Step
(1) Open the URL Encoder/Decoder. (2) Paste your text in the input field. (3) Click 'Encode' to convert special characters to percent-encoded format, or 'Decode' to reverse the encoding. (4) Copy the result.
Limitation
The encoder does not validate whether the input is a valid URL. It simply encodes all special characters. If you paste an entire URL, it will encode the protocol, domain, and path separators, making the URL unusable. Encode individual parameter values, not entire URLs.
Common Mistake
Double-encoding. If your string is already encoded (contains %xx sequences) and you encode again, % becomes %25, turning %20 into %2520. Always check if your input is already encoded before encoding again.
How It Compares
URLDecode.net is a simple online tool but has ads and requires pasting data to their server. Developer tools in browsers (Chrome DevTools Console: decodeURIComponent()) work but require opening the console. Our tool encodes and decodes instantly in your browser with no upload and a clean interface.
Privacy: All encoding and decoding happens in your browser. No data is sent to any server.
Next Step: If you need to encode binary data (images, files) into text format, use the Base64 Encoder instead.
Component Encoding vs Whole-URL Encoding
There are two levels of encoding and mixing them up is what breaks links. Full-URL encoding leaves the structure of the address alone — the colon, slashes, question mark, hash and ampersand that separate the parts — and encodes only what would be illegal there. Component encoding is stricter: it also encodes ? & = # and /, which is what you want for a value that is about to be pasted into a query string.
A practical rule: if you are adding one value to an existing URL, encode it as a component. If you are encoding a complete address that must survive being wrapped in another parameter, encode the whole thing as a component as well, then decode it once on the way out. One encode, one decode — every extra pass adds a %25.
When the Space Should Be a + Instead
Query strings inside a browser address bar happily accept %20, but server frameworks that parse form data expect + for a space. That difference is why a search term that works when typed into Google can arrive at an API as a literal plus. If your receiving endpoint reports spaces as + characters, the value was form-encoded — decode it with the form rule (plus becomes a space) rather than the percent rule. For paths, fragments and non-ASCII text, %20 is always correct, which is why the encoder uses it by default.
Building a Query String by Hand
Hand-built query strings break in the same few places every time: values containing spaces, values containing ampersands, and values containing non-ASCII text. Encode the value, not the whole URL — escaping a complete address also escapes the question mark and slashes that structure it, and the server then treats the path as data.
A practical order works well: start with the base URL, append the question mark and the first parameter name unencoded, encode the value, then join each additional name-value pair with an ampersand using the same rule. If a value legitimately contains an ampersand — a search for cats & dogs — encoding it as %26 keeps it inside the value instead of splitting the parameter in two.
Frequently Asked Questions
What is the difference between %20 and + for a space?
Both mean a space. + is the convention inside application/x-www-form-urlencoded bodies — the data a browser sends when you submit an HTML form — while %20 works everywhere, including paths, query values and JSON payloads. When you are unsure, use %20; it is valid in every position.
Should I encode the whole URL or only the values?
Only the values you insert. Encoding the scheme, domain and slashes produces %3A%2F%2Fexample.com, which is no longer a usable link. Build the URL structure yourself and run each user-supplied piece — search terms, redirect targets, filter names — through the encoder before appending it.
What happens if I encode a string twice?
The percent sign itself gets encoded, so %20 becomes %2520 and your decoder later returns the literal text %20 instead of a space. This double-encoding bug is the single most common cause of garbled query strings — check whether the input already contains % sequences before encoding again.
Why did my emoji turn into a long %F0%9F sequence?
Text is converted to UTF-8 bytes first, and an emoji occupies four bytes, so it needs four percent-encoded triplets. Chinese characters take three bytes and Latin characters one. The decoder reverses the process exactly, so the round trip still returns the original character.
Is my text sent to a server when I encode it?
No. Encoding and decoding run in your browser tab on the text in front of you. Nothing is uploaded, logged or stored, which matters when the string is an API key, a token or a private query.
Related Guides
Try it yourself
Open Tool →