URL encoder / decoder
Encode or decode URL components, whole URLs, and form values with direction controls and live output.
How it works & useful details
How to use this tool
Choose the URL mode, paste your text, and use Swap to reverse the conversion.
Details and limits
Component mode follows encodeURIComponent/decodeURIComponent. Whole URL mode follows encodeURI/decodeURI and preserves reserved separators; it is not a URL validator. Form mode converts spaces to + and decodes + as a space. A literal plus is encoded as %2B in component/form mode.
UTF-8 percent escapes must be complete and valid. Up to 100,000 input code units; live preview up to 8,000.
About this tool
URL encoder / decoder percent-encodes or decodes URL components, whole URLs, and form values. The direction controls decide whether spaces become %20 or +, which is the difference between a path component and a form field.
Encoding happens locally and the output updates live. Choose the mode that matches where the value will be used so you do not double-encode an already-encoded string.
How to use it
- Choose what you are working with: a component, a full URL, or form data.
- Select encode or decode.
- Paste the value and inspect the live output.
- Copy the result, checking for double-encoded sequences such as %2520.
Worked example
Encoding the text Fish & chips / 5€ = ok? as a component gives
Fish%20%26%20chips%20%2F%205%E2%82%AC%20%3D%20ok%3FEvery character that has a special meaning in URLs (&, /, =, ?) is escaped, along with spaces and non-ASCII characters. € becomes three bytes of UTF-8, %E2%82%AC. This is what you want for a single query parameter value or path segment.
Whole-URL mode, applied to https://example.com/a path/?q=Fish & chips, gives https://example.com/a%20path/?q=Fish%20&%20chips. Only the spaces are escaped, and the & is left alone because in a full URL it separates parameters. That shows why whole-URL mode cannot fix a value that contains & or =.
Choosing the right mode
- Component: individual query values, path segments, and fragment text. Equivalent to encodeURIComponent.
- Whole URL: making a complete URL with spaces or non-ASCII characters valid while keeping its structure. Equivalent to encodeURI.
- Form: application/x-www-form-urlencoded bodies and classic HTML form submissions, where spaces become +.
Double encoding is the classic bug: encoding an already-encoded value turns %20 into %2520. If a decoded result still contains %xx sequences, it was encoded twice. Also watch the + sign: in form data a literal plus must be written as %2B, or it decodes as a space.
Frequently asked questions
When should spaces become + instead of %20?
Form-encoded bodies use + for spaces, while URL path and query components use %20. Pick the mode that matches the destination.
Why did decoding change my value completely?
The input may have been encoded twice, or it may contain characters that are not valid in the selected mode. The tool reports invalid sequences instead of hiding them.
What is the limit?
Up to 100,000 characters of input.
Why do I get an error when decoding?
Every % must be followed by two hex digits, and multi-byte sequences must form valid UTF-8. A lone % or a truncated sequence such as %E2%82 is rejected instead of being guessed.
