How to encode or decode a URL
- 1Choose Encode or Decode with the buttons at the top.
- 2Leave the Full URL switch off to work on a single value, such as a query parameter or path segment (encodeURIComponent). Turn it on to process a whole URL while keeping characters like : / ? & = intact (encodeURI).
- 3Type or paste into the Input panel. The encoded or decoded result appears in the output panel as you type, with character counts for both sides.
- 4Click Copy to grab the result, or Save to download it as a .txt file.
How URL encoding works
URLs can only contain a limited set of ASCII characters, and several of those, such as / ? # & and =, have structural meaning. Percent-encoding, defined in RFC 3986, lets you include anything else by writing each byte as a % followed by two hex digits. A space becomes %20, an ampersand becomes %26, and non-ASCII text is first converted to UTF-8 bytes, so é becomes %C3%A9 and an emoji becomes four escaped bytes.
JavaScript gives you two functions, and picking the wrong one is a classic bug. encodeURIComponent escapes everything except letters, digits and - _ . ! ~ * ' ( ), which makes it the right choice for a single query value or path segment. encodeURI assumes you are passing a complete URL and leaves reserved characters like : / ? # & = + alone. If you run encodeURI on a query value that contains &, the & survives unescaped and silently splits your parameter in two.
Spaces are the other common confusion. In a URL path or with encodeURIComponent, a space is %20. HTML forms submitted as application/x-www-form-urlencoded use + for spaces instead, which is why you often see + in query strings. decodeURIComponent does not turn + back into a space, so form-encoded data needs that replacement done separately.
Watch out for double encoding too. If a value is encoded twice, % itself gets escaped and %20 becomes %2520. When a decoded URL still shows %XX sequences, decode it again. If decoding fails with a malformed URI error, the input has a % that isn't followed by two hex digits, or escapes that don't form valid UTF-8.
When developers reach for it
Building query strings by hand
Use it as a query string encoder for search terms, redirect URLs or JSON before appending them as parameters in a curl command or test.
Reading encoded log lines
Decode URL strings from access logs, such as request paths and query parameters, to see what users actually sent.
Debugging OAuth redirects
Decode a redirect_uri or state parameter to check it matches what your provider has registered.
Fixing double-encoded links
Spot %2520-style double encoding and decode step by step until the URL is clean.
Frequently asked questions
What's the difference between encodeURI and encodeURIComponent?
+
encodeURIComponent escapes reserved characters like / ? & = and is meant for a single value. encodeURI leaves them alone because it assumes you are encoding a complete URL. Use the Full URL switch to choose between them.
Should spaces be encoded as %20 or +?
+
%20 is correct everywhere in a URL. The + form only means a space in application/x-www-form-urlencoded data, such as HTML form submissions and many query strings.
Does the URL decoder convert + to a space?
+
No. Decoding uses decodeURIComponent or decodeURI, which leave + unchanged. Replace + with spaces first if you are decoding form-encoded data.
Why do I get a "URI malformed" error?
+
The input contains a % that isn't followed by two hex digits, or a sequence of escapes that doesn't form valid UTF-8. Check for a literal % sign that should itself have been encoded as %25.
Can a URL encoder online handle non-English text and emoji?
+
This one can. Text is converted to UTF-8 bytes before encoding, so ü becomes %C3%BC, and Japanese text or emoji become runs of escaped bytes that any modern server decodes correctly.
Is it safe to URL decode online if the string contains tokens?
+
Here it is. Encoding and decoding use the browser's built-in functions, so URLs with tokens or personal data never leave your machine.
Related tools
Base64 Decoder & Encoder
Encode text or files to Base64 format or decode Base64 strings.
JWT Decoder
Decode and inspect JWT tokens instantly. View header, payload, signature, expiration status, and time claims.
QR Code Generator
Generate a QR code from any text or URL. Customize colors, error correction, and quiet-zone margin, then download as PNG or SVG, copy the image, or share directly from your browser. Generation history saved locally.
JSON Formatter
Format and beautify JSON data with syntax highlighting and validation.