URL Encoder & Decoder
Convert text to URL-safe percent encoding and back, using the browser's own encodeURIComponent and decodeURIComponent functions. Useful for query strings, redirects, and OAuth redirect_uri values.
How to use this tool
- 1
Choose a mode with the Encode or Decode button at the top (Encode is selected by default).
- 2
Type or paste your text into the input box — a raw value to encode, or a percent-encoded string to decode.
- 3
Click Run to convert the text; the result appears in the monospace box below.
- 4
Copy the output from the result box, or switch modes and click Run again to reverse the conversion.
What is URL encoding and when do you need it?
URL encoding (also called 'percent encoding', specified in RFC 3986) is the process of converting characters that have special meaning in URLs — or characters that aren't safe in URLs at all — into a '%XX' hexadecimal escape sequence. The URL spec reserves certain characters for structural meaning: '?' starts the query string, '#' starts the fragment, '&' separates query parameters, '/' separates path segments, and so on. If user input contains any of those characters and you embed it raw in a URL, the parser misinterprets it. URL encoding sidesteps this by replacing every reserved or unsafe character with its hex byte representation prefixed by '%'. A space becomes %20, '&' becomes %26, '=' becomes %3D. Non-ASCII characters (Cyrillic, Chinese, emoji) become multi-byte UTF-8 sequences with each byte percent-encoded. Browsers handle this automatically when you click a link, but anytime you construct a URL programmatically — building a search query, a redirect target, an OAuth callback, a webhook signature — you must encode user-provided values first. This tool uses the same encodeURIComponent / decodeURIComponent functions your JavaScript code would, so the behavior matches production exactly.
Common use cases
Encode user search terms before appending to a search URL (?q=user+input).
Pass an OAuth redirect_uri parameter safely to an authorization server.
Construct webhook URLs that include encoded JSON payloads in the query string.
Encode a 'returnTo' URL so it survives being passed through other URLs.
Decode the encoded values you see in browser address bars after form submission.
Test how a malformed URL parses — encode a special character and see what happens.
Frequently asked questions
When should I URL-encode?▼
What's the difference between encodeURI and encodeURIComponent?▼
What's URL-safe Base64 vs URL encoding?▼
Why does '+' sometimes decode to space?▼
How are non-ASCII characters encoded?▼
Is URL encoding the same as HTML entity encoding?▼
What happens if I try to decode an invalid percent sequence?▼
Is my data uploaded anywhere?▼
Related tools
JWT Decoder
Decode JSON Web Tokens (JWT) instantly — inspect the header, payload, and signature claims. Runs entirely in your browser; tokens never leave your device. Safe for production secrets.
JSON Formatter & Validator
Format, validate, and minify JSON instantly. Catches syntax errors with line numbers, pretty-prints with adjustable indent, supports large payloads. Runs in your browser — no upload.
XML Formatter & Beautifier
Format and beautify XML documents — proper indentation, line breaks, namespace handling. Useful for SOAP responses, sitemaps, RSS feeds, and Android resource files.
Base64 Encoder & Decoder
Encode and decode Base64 strings.
HTML Entity Encoder & Decoder
Convert special characters to/from HTML entities.
CSS Minifier
Minify CSS to reduce file size.