Skip to content

URL Encode and Decode

Encode special characters for URLs or decode percent-encoded strings back to readable text.

URL Encode and Decode tool

Loading...

Example

Input: a b&c=d/é

Result: a%20b%26c%3Dd%2F%C3%A9

Reserved characters are percent-encoded: space becomes %20, & becomes %26, = becomes %3D and / becomes %2F. The é is encoded as its two UTF-8 bytes, %C3%A9.

How Common Characters Are Encoded

CharacterEncoded
space%20
&%26
=%3D
?%3F
#%23
/%2F
:%3A
+%2B
@%40
,%2C
! ~ * ' ( )unchanged
é%C3%A9
€%E2%82%AC

Output of encodeURIComponent, which this tool uses.

  1. To encode, type or paste plain text into the Decoded URL panel.
  2. To decode, paste a percent-encoded string into the Encoded URL panel instead.
  3. The other panel updates instantly, using encodeURIComponent rules for encoding.
  4. If the encoded text contains an invalid sequence such as a lone %, read the error message and fix the input.
  5. Click the copy button above either panel to copy the transformed text to your clipboard.

Percent Encoding for URLs Explained

URL encoding, also called percent encoding, replaces characters that are not safe in a URL with a % sign and two hex digits. A space becomes %20, & becomes %26 and é becomes %C3%A9. Type plain text in the left panel to encode it, or paste encoded text in the right panel to decode it. Some characters have a job inside a URL. The ? starts the query string, & separates parameters, = joins a key to its value and # starts the fragment. If a search term contains one of them, such as Tom & Jerry, it must be encoded or the server will split it in the wrong place. Characters outside basic ASCII are first turned into UTF-8 bytes, and each byte gets its own %XX code.

The encoder uses JavaScript's encodeURIComponent. It leaves letters, digits and - _ . ! ~ * ' ( ) alone and encodes everything else, including / ? : @ & = + and #. That is the right choice for one query value or one path segment. Do not run a whole URL through it, because the :// and every slash will be encoded too. To split a full URL into its parts, use the URL Parser.

The decoder turns every %XX sequence back into its character. A + sign stays a +, since only HTML form encoding uses + for a space. A stray % that is not followed by two hex digits, or bytes that do not form valid UTF-8, produce an error message rather than a wrong result.

Sources

Frequently Asked Questions

Both are correct in their own place. Plain percent encoding, used in paths and by encodeURIComponent, writes a space as %20. HTML forms submitted with the default form encoding write it as +, and most servers decode + as a space in query strings. This tool uses %20 when encoding, and when decoding it leaves + unchanged.
encodeURI is meant for a complete URL, so it leaves characters such as : / ? & = and # alone. encodeURIComponent is meant for one piece of a URL, such as a single query value, and encodes those characters too. This tool uses encodeURIComponent, which is the one you want when inserting user input into a URL.
%25 is the code for the % sign itself, so %2520 means a %20 was encoded a second time. This double encoding usually happens when code encodes a value that was already encoded. Paste the text into the decoder once to get %20, and again to get the space. Then fix the code so it encodes only once.
The decoder expects every % to start a valid code such as %20. Text like 100% or %G1 cannot be decoded, and neither can codes that form broken UTF-8, such as %C3 on its own. If a literal percent sign belongs in the value, it should have been encoded as %25.
No. URL encoding writes characters as %XX so they can travel inside a URL. HTML encoding writes them as entities such as & and < so they show as text on a web page. A link inside HTML can need both: percent encoding for the URL itself and & for any & in the href attribute.

Related Tools

Base64 Encode and Decode

Encode text to Base64 and decode Base64 strings back to readable text, with full UTF-8 support.

Developer Tools

HTML Entity Encode and Decode

Convert special characters to HTML entities and decode HTML entities back to readable text.

Developer Tools

JSON Formatter and Validator

Format, validate, beautify, and minify JSON data with a collapsible tree view and line-and-column error detection.

Developer Tools

URL Parser

Break down URLs into protocol, host, port, path, query parameters, and hash components.

Developer Tools

Regex Tester

Test regular expressions with real-time match highlighting, group capture display, and a pattern library.

Developer Tools

JWT Decoder

Decode JSON Web Tokens to inspect header, payload, and signature without needing the secret key.

Developer Tools