URL Encoder & Decoder
Encodes as you type. Text stays in your browser.
encodeURI() percent-encodes a complete URL. Reserved characters such as : / ? # & = stay readable so the URL structure is not destroyed. Uses encodeURI(). Hindi, emoji, and other Unicode become UTF-8 percent sequences.
Max 1,048,576 characters · encodeURI()
Type or paste text or a URL to encode.
Query string parser
Inspect key/value pairs, edit them, and rebuild the URL. Duplicate keys and Unicode values are kept.
Paste a URL or query string to inspect and edit its parameters.
Online URL Encoder & Decoder
Looking for a URL encoder, URL decoder, or a place to URL encode and URL decode online? Toolshelf percent-encodes text in your browser — no signup and no uploads.
Choose URL Encode, URL Decode, Component Encode, or Component Decode. The result updates as you type. Invalid percent encoding shows a clear error instead of crashing.
What you can do with this URL tool
- URL encode a complete address with encodeURI()
- URL decode without rewriting reserved characters
- Component encode query values with encodeURIComponent()
- Component decode every valid percent sequence
- Query string parser with editable key/value pairs
- Unicode-safe percent encoding for Hindi, emoji, and CJK text
- Clear errors for incomplete or invalid percent encoding
- Copy, swap, download, or rebuild a URL locally
encodeURI() vs encodeURIComponent()
JavaScript exposes two percent-encoding functions. They look similar and are easy to mix up. This page keeps them as separate modes so you can see the difference on the same input.
| Function | Use for | Leaves unchanged |
|---|---|---|
| encodeURI() | A complete URL | A–Z a–z 0–9 ; , / ? : @ & = + $ - _ . ! ~ * ' ( ) # |
| encodeURIComponent() | One query value, path segment, or form field | A–Z a–z 0–9 - _ . ! ~ * ' ( ) |
Example: https://example.com/a b becomes https://example.com/a%20b with encodeURI(), but https%3A%2F%2Fexample.com%2Fa%20b with encodeURIComponent(). The second form is correct when the entire address is a single query value, and wrong when you still need a clickable URL.
What is percent encoding?
Percent encoding represents a byte as % plus two hexadecimal digits. URLs are defined over a limited ASCII set, so spaces, quotes, non-ASCII letters, and many punctuation marks must be encoded before they travel in a path or query string.
Unicode is encoded as UTF-8 first. The Hindi word नमस्ते becomes a sequence of %E0 bytes, not one escape per visual letter. Decoding must reverse that UTF-8 step or the result will be garbage.
Query string parser
The query string is the part after ? and before #. Paste https://example.com/products?id=123&sort=price to see id / 123 and sort / price. Edit a value and copy the reconstructed URL. Duplicate keys, flag parameters without =, and Unicode values are preserved.
Common uses
Encode a full URL
Turn spaces and Unicode in a complete address into percent sequences without encoding :, /, ?, or #. Use URL Encode when the input is already a URL.
Encode a query value
Use Component Encode for one parameter, path segment, or form field so &, =, and ? cannot be mistaken for URL syntax.
Read encoded logs
Paste a percent-encoded URL or query string from a log, ticket, or redirect and decode it locally.
Edit query parameters
Parse https://example.com/products?id=123&sort=price, change a value, and copy the reconstructed URL.
Handle Unicode URLs
Confirm that Hindi, Gujarati, emoji, or CJK text survives percent encoding as UTF-8 sequences.
Compare the two APIs
See when encodeURI() and encodeURIComponent() diverge on the same input, instead of guessing which one to call.
How to URL encode or decode
- 1Choose URL Encode for a complete address, or Component Encode for one value.
- 2Paste the URL or text. The encoded or decoded result updates as you type. Use a sample to confirm Unicode handling.
- 3Copy the output, swap the panels to reverse the last step, or download a
.txtfile. Use the query parser when you need to edit parameters.
Limits
- Input is capped at 1,048,576 characters so a huge paste cannot freeze the tab.
- Encoding rejects incomplete Unicode surrogate pairs. Decoding rejects incomplete escapes, invalid hex, and invalid UTF-8.
- This is percent encoding, not encryption. Anyone can decode the result. Do not treat an encoded URL as a secret.
- Query reconstruction encodes keys and values with encodeURIComponent(). Optional + encoding is for form-style query strings.
Frequently asked questions
- What is a URL encoder?
- A URL encoder turns characters that are unsafe in a URL into percent-encoded UTF-8 sequences such as %20 for a space. This online URL encoder can encode a complete URL or a single component in your browser.
- What is a URL decoder?
- A URL decoder reverses percent encoding. This tool can URL decode with decodeURI() or component-decode with decodeURIComponent(). Invalid sequences produce a readable error instead of a crash.
- What is the difference between encodeURI() and encodeURIComponent()?
- encodeURI() is for a complete URL. It leaves reserved characters such as : / ? # & = intact so the structure stays valid. encodeURIComponent() is for one part of a URL — a query value, path segment, or form field — and encodes those reserved characters too. Use URL Encode for a full address and Component Encode for a single value.
- What is percent encoding?
- Percent encoding (also called URL encoding) replaces a byte with a percent sign and two hexadecimal digits. A space becomes %20. The Devanagari letter न becomes %E0%A4%A8 because it is three UTF-8 bytes. This is defined by RFC 3986.
- When should I use decodeURI() instead of decodeURIComponent()?
- Use decodeURI() / URL Decode when the input is a complete encoded URL and you want reserved escapes such as %3F and %2F to stay encoded. Use decodeURIComponent() / Component Decode for a single encoded parameter. Decoding a full URL with decodeURIComponent() can turn ? and / back into syntax and break the address.
- Does this URL encoder support Unicode?
- Yes. Characters are encoded as UTF-8 percent sequences. Hindi, Gujarati, Chinese, Japanese, emoji, and accented letters round-trip correctly. Incomplete surrogate pairs are rejected with an error instead of throwing.
- Why does + sometimes mean a space?
- HTML form submissions (application/x-www-form-urlencoded) encode spaces as +. encodeURIComponent() uses %20 instead. Enable “Treat + as space” when decoding form-style query strings.
- What happens if percent encoding is invalid?
- A lone %, a truncated sequence such as %2, or non-hex digits such as %GG produce a message that includes the snippet and its position. Invalid UTF-8 sequences are also reported. The page does not invent decoded text.
- Do I need an account to use this URL encoder?
- No. Toolshelf URL Encoder & Decoder requires no account and no uploads.
- Does this tool send my URLs to a server?
- No. Toolshelf encodes, decodes, and parses query strings locally in your browser. Input is not uploaded, not written to localStorage, and not placed in the page URL.
Related guides
Short articles that explain the problem this tool solves.
- encodeURI vs encodeURIComponent — encodeURI() encodes a full URL and leaves reserved characters alone. encodeURIComponent() encodes one value so &, =, and ? cannot break query strings. See examples and common mistakes.
Related tools
Continue with related browser-based tools on Toolshelf.
- Base64 Encoder & Decoder — Online Base64 encoder and decoder.
- JWT Decoder & Inspector — Online JWT decoder and inspector.
- JSON Formatter & Minifier — JSON formatter online: beautify, minify, and validate JSON in your browser.
- Regex Tester — Online Regex Tester and Debugger.
- Image to Base64 Converter — Image to Base64 converter.
- Hash Generator — Online hash generator.
- AES Encrypt Decrypt — AES encrypt decrypt online.
- HTML Encoder & Decoder — HTML encoder online.
Ready to URL encode or decode?
Scroll up, paste a URL or query string, and copy the result. Processing stays in this browser tab.
Back to encoderWhat would you like to do next?
Continue working with the next step in this workflow. Recently used tools in this set are listed first.
- Base64 Encoder & Decoder — Online Base64 encoder and decoder.
- JWT Decoder & Inspector — Online JWT decoder and inspector.
- JSON Formatter & Minifier — JSON formatter online: beautify, minify, and validate JSON in your browser.
- Regex Tester — Online Regex Tester and Debugger.
Related guides
Short articles that explain the problem this tool solves.
- encodeURI vs encodeURIComponent — encodeURI() encodes a full URL and leaves reserved characters alone. encodeURIComponent() encodes one value so &, =, and ? cannot break query strings. See examples and common mistakes.
You may also need
Continue with related browser-based tools on Toolshelf.
- Base64 Encoder & Decoder — Online Base64 encoder and decoder.
- JWT Decoder & Inspector — Online JWT decoder and inspector.
- JSON Formatter & Minifier — JSON formatter online: beautify, minify, and validate JSON in your browser.
- Regex Tester — Online Regex Tester and Debugger.
- Image to Base64 Converter — Image to Base64 converter.
- Hash Generator — Online hash generator.
- AES Encrypt Decrypt — AES encrypt decrypt online.
- HTML Encoder & Decoder — HTML encoder online.