URL Encoder and Decoder
Percent-encodes and decodes URLs, and breaks a URL into scheme, host, path and query parameters. Handles the difference between encoding a whole URL and encoding a single component.
URL Encoder and Decoder
Escapes ? & = / # too — use this for a single value going into a query string.
Result
https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dhello%20world%26lang%3D%E0%B7%83%E0%B7%92%E0%B6%82%E0%B7%84%E0%B6%BD
This URL, broken up
- Scheme
- https
- Host
- example.com
- Path
- /search
| Parameter | Value |
|---|---|
| q | hello world |
| lang | සිංහල |
How to use it
- Paste a URL or a fragment of one into the box.
- Choose encode or decode.
- Use component encoding for a single query value — it escapes ampersands, slashes and question marks that would otherwise change the URL's structure.
- Use full-URL encoding when you have an entire address and want to keep its separators intact.
- Paste a complete URL to see it split into scheme, host, path and each query parameter separately.
Frequently asked questions
- What is the difference between encodeURI and encodeURIComponent?
- encodeURI leaves URL separators like slash, question mark and ampersand alone, so it is for whole URLs. encodeURIComponent escapes them, which is what a single query value needs.
- Why does a space become %20 sometimes and + other times?
- Plus is a form-encoding convention from HTML form submissions, valid in a query string but not elsewhere. %20 is correct everywhere, which is why it is the safer choice.
- Why does my decode fail with a malformed URI error?
- A percent sign must be followed by two hex digits. A literal percent in text — a discount code, for instance — must itself be encoded as %25 before decoding will work.
Related tools
- Base64 Encoder and DecoderEncode and decode Base64 in your browser, including URL-safe Base64. Handles emoji, Sinhala and Chinese, which btoa-based tools cannot.
- Case ConverterSwitch text between camelCase, snake_case, kebab-case, Title Case and eight more. Handles acronyms correctly. Includes a URL slug maker.
- JSON Formatter and ValidatorPretty-print, minify or sort JSON, and get syntax errors reported by line and column with the offending line shown. Runs entirely offline.
Built and maintained by Kavitha Kanchana
Software engineer at Cortana AI and co-founder of Ryzera Technologies, based in Sri Lanka. Found a bug or a wrong number? Email me.