Image, File and Developer Tools
URL Encoder and Decoder
Encode a full URL or a single URL component, and decode URLs and components back again — with Unicode handled correctly and invalid percent-sequences reported instead of silently mangled. Everything runs in your browser.
Calculation History
Your recent calculations on this device. Stored only in your browser, never uploaded.
No calculations yet on this device.
How to Use
Paste a URL or a piece of text, choose what to do — encode a full URL, encode a component, decode a URL or decode a component — and press Convert. The result appears in the output box; use Copy result to copy it. Your input never leaves your browser.
Formula and Methodology
Encode full URL uses encodeURI: it encodes spaces and unsafe characters but leaves the characters that give a URL its structure (: / ? # & = and others) untouched. Encode component uses encodeURIComponent: it encodes those structure characters too, so the result is safe to use as a single value inside a URL. Decoding reverses each operation with decodeURI or decodeURIComponent. A percent-sequence that is not valid UTF-8 (for example a lone % or %A) is rejected with an error instead of producing a wrong character.
Examples
Press "Try an example" in the calculator above to fill in these values.
- Text
- https://example.com/a b&c?x=1&y=2
- Mode
- component
Tips
Encoding a whole URL with the component mode breaks it: the slashes and question mark become %2F and %3F. Use the full-URL mode for complete addresses.
When a value you put in a query string contains & or =, encode it as a component first, or it will be read as a new parameter.
Frequently Asked Questions
encodeURI is for a complete URL: it keeps : / ? # & and = so the address still works, and only encodes characters that are not allowed in a URL. encodeURIComponent is for one value inside a URL: it encodes those structure characters as well, so a value containing & or = cannot break the surrounding address.
Decode a component when the text is a single encoded value (for example one query-string value). Decoding a full URL with the component mode can turn its %2F sequences back into slashes in the wrong places.
The tool reports it as an error and leaves the output empty. A common cause is a stray % sign or a truncated percent-sequence such as %E0%A4%A, which is not a complete UTF-8 character.