Free tool
URL Encoder Decoder
Percent-encode or decode text, and break a full URL into its host, path and decoded query parameters.
How it works
What is the URL Encoder Decoder?
The URL Encoder Decoder is a free tool that percent-encodes text with JavaScript's encodeURIComponent or decodes it back. When you paste a full URL it also shows a breakdown: protocol, host, path, fragment and every query parameter with its decoded value. It warns when a string cannot be decoded.
How to use the URL Encoder Decoder
- Paste a URL, a query value or encoded text, or press Load sample.
- Choose Encode or Decode.
- Copy the result from the output box.
- If you pasted a full URL, read the breakdown table for its decoded query parameters.
What is URL encoding?
URL encoding, also called percent-encoding, replaces characters that are not allowed or have a special meaning in a URL with a percent sign and two hexadecimal digits. A space becomes %20, an ampersand %26, a slash %2F. Characters outside ASCII are first turned into UTF-8 bytes, so é becomes %C3%A9.
It exists because a URL uses certain characters as structure. ? starts the query, & separates parameters, = splits a name from its value and # starts the fragment. A value that contains one of these has to be encoded or it will be read as structure.
What does encodeURIComponent encode?
Everything except letters, digits and these nine characters: - _ . ! ~ * ' ( ). That makes it the right function for a single piece of a URL, such as one query value or one path segment.
It is the wrong function for a whole URL you still want to use as a link, because it also encodes :, /, ?, & and =. Encode each value separately and then join them. For campaign links, the UTM Builder does that assembly for you.
How do I decode a URL?
Switch to Decode and paste the encoded text. Each %XX sequence is turned back into its character with decodeURIComponent.
Decoding fails when a % is not followed by two hex digits, or when the bytes are not valid UTF-8. The usual cause is a literal percent sign, as in 50% off, that was never encoded as %25. The tool tells you when that happens and does not guess. Text that was encoded twice, such as %2520, needs decoding twice.
Is a space %20 or a plus sign?
Both exist, in different places. %20 is the percent-encoding of a space and is valid anywhere in a URL. The plus sign means a space only inside a query string, a convention that comes from HTML form submissions.
This matters when decoding. decodeURIComponent leaves + as a plus, so the main output box does too. The breakdown table parses the query string the way browsers do with URLSearchParams, so there a + is shown as a space.
How do I read the query parameters of a long URL?
Paste the full URL, starting with https://. Under the output, the breakdown lists the protocol, host, path and fragment, then one row per query parameter with its value decoded. Tracking links with a dozen utm_ and click ID parameters become a readable table.
Repeated parameter names are each given their own row, in the order they appear. To build a clean path segment from a title, use the URL Slug Generator. To find links on a page that no longer work, use the Broken Link Checker.
Questions
- What is the difference between encodeURI and encodeURIComponent?
encodeURIis meant for a whole URL and leaves structural characters such as:,/,?,&,=and#alone.encodeURIComponentencodes those too, so it is for a single value. This tool usesencodeURIComponent.- Why is a space sometimes %20 and sometimes +?
%20works everywhere in a URL.+means a space only in query strings, following the HTML form encoding rules.- Do I need to encode a URL for SEO?
- Use plain lowercase words and hyphens in paths so nothing needs encoding. Non-ASCII characters in URLs are valid but must be percent-encoded when sent, which browsers do for you.
- Why does decoding fail with a malformed error?
- The text has a
%that is not followed by two valid hex digits, or bytes that are not valid UTF-8. A literal percent sign must be written as%25. - Is the URL Encoder Decoder free?
- Yes, with a free spyc.ai account. It runs in your browser, so nothing you type or paste is sent to a server.
Developer Tools
More in Developer Tools
JSON Formatter
Format, minify and validate JSON in your browser, with the line and column of the first syntax error.
Format JSONJSON-LD Formatter
Pretty-print JSON-LD pasted bare or in script tags, list every @type and flag a missing @context.
Format JSON-LDCase Converter
Convert text to upper, lower, title or sentence case, or to camelCase, PascalCase, snake_case and kebab-case.
Convert caseReady when you are
Before your next buyer asks AI about you, ask AI about yourself
One check, four engines, about twenty seconds. We show you the answers before we ask for anything.