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.

Encode a full URL when the address must keep working; encode a component when one value goes inside a URL. Invalid percent-sequences are reported, never silently mangled.

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