URL Encoder & Decoder Guide
URLs can only contain a limited set of ASCII characters. Anything else — spaces, accented letters, emoji, or characters that have a special meaning in a URL such as &, =, ? and # — has to be percent-encoded: each byte of its UTF-8 form is written as % followed by two hex digits, so 'café' becomes 'caf%C3%A9' and a space becomes '%20' (or '+' in form data). This tool encodes and decodes text in the three styles you meet in practice, and breaks any URL into its protocol, host, path, fragment and individual query parameters.
⚙️ Key Features
- Three encoding styles: Component (encodeURIComponent) for single values, Full URL (encodeURI) for whole addresses, and Form (application/x-www-form-urlencoded) with spaces as '+'.
- Live results as you type, with a one-click Swap to reverse the direction.
- Tolerant decoding: malformed sequences such as a stray '%' or invalid UTF-8 bytes are kept as-is and listed, instead of failing the whole input.
- Detects double-encoded input (e.g. %2520) and offers to decode it again.
- URL breakdown with every query parameter decoded and individually copyable.
- 'Each line separately' mode for encoding or decoding lists of values.
📖 How to Use
- Choose Encode or Decode, then pick the style: Component for a query value or path segment, Full URL to keep the URL structure, or Form for HTML form bodies.
- Type or paste your text, or click 'Sample' to try an example.
- Copy the result. Click 'Swap' to feed the result back in and switch direction.
- If you pasted a full URL, scroll down to the URL breakdown to read or copy individual parts and query parameters.
Encoding, decoding and URL parsing run entirely in your browser using built-in JavaScript functions. URLs often carry tokens, session IDs and personal data in their query strings, and none of it is sent to a server or stored.
Frequently Asked Questions (FAQ)
What is the difference between encodeURI and encodeURIComponent?
encodeURI assumes its input is a complete URL, so it leaves characters that structure a URL (: / ? # & = @ +) untouched. encodeURIComponent assumes its input is one piece of a URL, such as a single query value, and encodes those characters too. Use Component when inserting user input into a URL — otherwise a value containing '&' would split into two parameters.
Should a space be %20 or +?
Both are correct in different places. '+' means a space only in application/x-www-form-urlencoded data, i.e. HTML form submissions and most query strings parsed by servers. Everywhere else, including URL paths, a space must be %20. When in doubt, %20 is the safer choice; choose the Form style when you need '+'.
Why do I get 'URI malformed' errors elsewhere?
JavaScript's decodeURIComponent throws on a '%' that isn't followed by two hex digits, or on byte sequences that aren't valid UTF-8 (for example text encoded with Latin-1). This tool decodes everything it can and leaves just the broken sequences in place, listing them so you can fix the source.
What does double encoding look like?
If an already encoded value is encoded again, every '%' becomes '%25', so a space turns into %2520. It usually happens when both a framework and your own code encode the same value. The tool notices when a decoded result still contains percent-encoding and offers to decode it again.