URL Encoder and Decoder
Free URL encoder and decoder. Percent-encode or decode strings, build query strings from parameters, and inspect a URL into its protocol, host, path, query and fragment parts.
Free, no sign-upRuns in your browserNothing uploaded
Encoded
Output, read only.
Which encoding should I use?
- encodeURIComponent
- Escapes everything reserved, including
/ ? & = #. Use this for a single value going into a query string or a path segment. - encodeURI
- Leaves reserved characters alone because they define the URL structure. Use this for a whole URL you are building.
- form-urlencoded
- Identical to encodeURIComponent except a space becomes
+. This is what HTML form submission uses.
URL encoding replaces characters that are not allowed in a URL with a percent sign followed by two hexadecimal digits. A space becomes %20, an ampersand becomes %26, a slash inside a query value becomes %2F. It exists so arbitrary text - including your own ampersands and question marks - can travel inside a URL without being mistaken for URL structure.
This tool offers the three encodings that are easy to confuse. encodeURI escapes a whole URL but deliberately leaves reserved characters alone, so it is right for a link you are building. encodeURIComponent escapes everything reserved, so it is right for a single value inside a query string. The application/x-www-form-urlencoded encoding used by HTML forms is subtly different again, turning spaces into + instead of %20.
There is also a URL inspector that breaks any link into its protocol, host, port, path, query parameters and fragment, with every component decoded as well as raw. That is how you find the tracking parameters you did not know a link had, or why two apparently identical URLs are not equivalent.
URL Encoder & Decoder features
How to use the URL Encoder & Decoder
Pick a mode
Encode, decode, or inspect. The encode and decode panels each have quick presets for whole URLs, query values, path segments and form bodies.
Paste your string
Output updates as you type. Pick between the encodeURI, encodeURIComponent and form-urlencoded behaviours, which differ on exactly the characters people trip over.
Inspect a full URL
The inspector shows scheme, host, port, path, each query parameter decoded and raw, and the fragment, plus a rebuilt canonical URL.
Build a query string
Add key and value rows and the tool generates the correctly encoded parameter string, ready to append to any endpoint.
Frequently asked questions
What is the difference between encodeURI and encodeURIComponent?
Should a space be %20 or +?
How do I encode a JSON string for a query parameter?
Why does my URL have %2520 in it?
How long can a URL be?
Does encoding change the data?
Related tools
Every tool, in one place
ToolForge has url encoder & decoder plus a growing set of image, colour and developer tools. All of them run locally in your browser, free and without an account.
Browse all tools