URL Encode / Decode
Percent-encode and decode text and URLs, and break a URL into its parts.
Runs in your browser. Nothing is uploaded.
What is URL Encode / Decode?
URL encoding, also called percent-encoding, is how characters that are not allowed in a web address are written safely. Each such character is replaced by a percent sign and two hexadecimal digits, so a space becomes %20 and the letter é becomes %C3%A9. Without it, a space, an ampersand or an accented letter in a query string could break a link or change what a server understands.
This URL encoder and decoder handles the three situations developers meet. Component mode encodes a single value, such as a query parameter, and is the same as JavaScript's encodeURIComponent. Full URL mode keeps the characters that give a URL its structure, such as the slashes, question mark and ampersand, and is the same as encodeURI. Form mode writes a space as a plus sign, as HTML forms do. Decoding is forgiving: broken percent sequences are kept as they were and listed in a note, bytes that are not valid text are marked, and a hint warns you when your text looks double-encoded, a classic bug where %20 becomes %2520.
A second tab breaks any URL into its parts: protocol, user, host, port, path, query string and fragment, with every query parameter decoded in a table, and it also reads a bare query string. You can convert a whole list line by line, add characters you want encoded too, and swap input and output in one click. Everything runs in your browser and nothing you enter is uploaded.
How to use
- Choose Encode or Decode, and pick the mode: Component for a single value, Full URL for a whole address, Form for form data.
- Type or paste your text. The result appears as you type, with Copy and Swap buttons.
- Tick Line by line to convert each line of a list on its own, or list extra characters to encode.
- Read the notes and hints below the result, which flag broken sequences and double encoding.
- Open the URL breakdown tab to split a URL or query string into its parts and decoded parameters.
Example
Input
name=Ada Lovelace&city=São Paulo
Output
name%3DAda%20Lovelace%26city%3DS%C3%A3o%20Paulo
Frequently asked questions
- What is the difference between encodeURI and encodeURIComponent?
- encodeURIComponent encodes everything except letters, digits and a few symbols, so it is right for one value such as a query parameter. encodeURI also leaves characters like / ? & = and # alone so a complete URL keeps working. Use Component for values and Full URL for whole addresses.
- Why does a space sometimes become + and sometimes %20?
- Percent-encoding writes a space as %20. HTML form data, the application/x-www-form-urlencoded format, writes it as +. The Form mode uses the plus sign, and decoding in Form mode turns + back into a space.
- What is double encoding?
- It happens when already-encoded text is encoded again, so %20 becomes %2520. The tool warns you when it sees %25 followed by two hex digits while decoding, or an existing %XX sequence while encoding.
- Is my text sent to a server?
- No. Encoding, decoding and URL parsing all happen in your browser and nothing you enter is uploaded.
Related tools
- Base64 Encode / DecodeBase64 encode and decode text with full UTF-8 and URL-safe support.
- JSON Formatter & ValidatorFormat, minify and validate JSON online with line-accurate error messages.
- JWT DecoderDecode a JWT and inspect its header, payload and expiry in your browser.
- Case ConverterConvert text to camelCase, snake_case, kebab-case and more.