Developer Tools
URL Encoder & Decoder
Percent-encode URLs or components for safe links, and decode encoded URLs back instantly.
Paste a URL or text, choose a mode, and press Encode or Decode.
What is URL encoding?
URLs may only contain a limited set of ASCII characters, so anything else — spaces, Urdu text, emoji, or reserved symbols inside a value — must be percent-encoded as % followed by two hexadecimal digits (a space becomes %20). Encoding also protects reserved characters like ?, &, and = when they appear inside a query value rather than as URL structure. This tool offers both standard modes: encodeURI for whole URLs (leaving structural characters intact) and encodeURIComponent for individual values (encoding everything that is not unreserved), plus decoding back to the original.
How to use this tool
- Paste your URL or text into the input box.
- Choose Full URL when encoding a complete link, or Component when encoding a single query value or path segment.
- Press Encode to percent-encode, or paste encoded text and press Decode to restore it.
- Copy the result with Copy output.
Key features
- Two correct modes: encodeURI preserves : / ? # & = structure; encodeURIComponent encodes them too.
- Full UTF-8 support — non-ASCII text like Urdu encodes to proper multi-byte % sequences.
- Decoding validates % sequences and reports malformed input clearly instead of producing garbage.
- One-click copy with fallback for older browsers.
- Runs entirely client-side; your URLs never leave the browser.
Common use cases
- Building share links with pre-filled text, such as WhatsApp or Twitter intent URLs.
- Debugging redirect chains and analytics tags by decoding long encoded URLs.
- API work: safely placing user input into query parameters without breaking the request.
- UTM parameters: encoding campaign names that contain spaces or special characters.
- File downloads: encoding filenames with spaces or non-ASCII characters in links.
Practical tips
- Encode values, not whole URLs, when building query strings — encoding the ? and & of a URL you then append parameters to will break it.
- Never double-encode: %25 is the encoding of %, so encoding twice turns %20 into %2520.
- A + in a query string means a space in application/x-www-form-urlencoded data, but %20 in a path — decodeURIComponent does not convert + to space.
- Modern browsers display decoded characters in the address bar but copy the encoded form; decode here to see the real value.
- When in doubt, encodeURIComponent is the safer default for anything going inside a URL.
Frequently Asked Questions
What is the difference between encodeURI and encodeURIComponent?
encodeURI is for whole URLs — it leaves structural characters like : / ? # & = alone. encodeURIComponent is for a single value inside a URL and encodes those characters too, so the value cannot break the URL's structure.
Why do spaces become %20?
URLs cannot contain literal spaces, so each space is replaced by its UTF-8 byte value in hexadecimal, prefixed with %. In form-encoded query strings a space may also appear as +.
What causes 'malformed URI sequence' errors when decoding?
A % not followed by two valid hex digits, or a truncated multi-byte UTF-8 sequence. It usually means the text was only partially encoded or was corrupted in transit.
Should I encode an entire URL before using it in an href?
Usually not — a valid URL is already encoded where it needs to be. Encode the individual values you insert into it, not the finished URL.
Does this tool upload my URLs anywhere?
No. Encoding and decoding use the browser's built-in functions locally, so your links and data stay on your device.