URL Encode / Decode
Percent-encode strings for URLs or decode them back. Choose between encodeURI and encodeURIComponent behavior.
Percent-encoding replaces unsafe characters in URLs with %XX sequences. There are two flavors: encodeURI preserves URL syntax (so : / ? # & = + remain), while encodeURIComponent encodes everything that isn't unreserved — use it for individual query-string values.
The decoder handles any percent-encoded UTF-8, including emojis and Czech diacritics. Invalid sequences produce a clear error message.
Example
Input
https://example.com/search?q=hello world&lang=čeština Output
https://example.com/search?q=hello%20world&lang=%C4%8De%C5%A1tina Frequently asked questions
encodeURI vs encodeURIComponent?
encodeURI is for whole URLs (preserves : / ? # &). encodeURIComponent is for embedding a single value into a URL (escapes everything reserved). Pick the right one based on whether the input is a full URL or just a parameter value.
Why does '+' decode to a space sometimes?
In application/x-www-form-urlencoded payloads (form submissions, query strings), '+' represents a space. Toggle 'Form mode' to apply this rule.