URL Encoder / Decoder

Percent-encode text for URLs and query strings, or decode %XX sequences back to UTF-8 text. Choose whether reserved characters like / ? & = are encoded. Spaces become + as in HTML form encoding. Text files can be dropped in, and everything is processed in your browser.

About this tool

What is URL encoding?

URL encoding, also called percent-encoding, replaces characters that are not allowed or have a special meaning in a URL with % followed by two hexadecimal digits. Non-ASCII text such as accented letters or Japanese is first converted to UTF-8 bytes, and each byte is written as %XX. For example, é becomes %C3%A9. This tool encodes text into that form and decodes percent-encoded strings back into readable text.

How to use

  1. Enter text into Raw data, or drop a text file onto it.
  2. Choose whether to check Also encode reserved characters (see below).
  3. Click Encode. The result appears in Encoded data.
  4. To decode, paste an encoded string into Encoded data and click Decode.
  5. Use the buttons in the corner of each editor to copy, download, or view full screen.

Features

  • Encode and decode in both directions with the Encode / Decode buttons
  • Also encode reserved characters on (default): encodes / ? : @ & = + $ , ; # too, like JavaScript's encodeURIComponent. Use this for a single query parameter value or path segment.
  • Option off: keeps the URL structure readable, like encodeURI, and only encodes spaces, non-ASCII characters and other unsafe characters. Use this for a whole URL. + is still encoded as %2B.
  • Spaces are encoded as +, and + is decoded as a space, matching application/x-www-form-urlencoded
  • UTF-8 for non-ASCII characters
  • Clear error messages for malformed input such as an incomplete %XX sequence
  • Text file input, with copy and download buttons on both sides

Examples

InputReserved characters encodedNot encoded
hello world & morehello+world+%26+morehello+world+&+more
a+b=ca%2Bb%3Dca%2Bb=c
東京%E6%9D%B1%E4%BA%AC%E6%9D%B1%E4%BA%AC
https://example.com/?q=caféhttps%3A%2F%2Fexample.com%2F%3Fq%3Dcaf%C3%A9https://example.com/?q=caf%C3%A9

FAQ

Why are spaces encoded as + instead of %20?

This tool follows HTML form encoding, where a space is +. Most servers decode both + and %20 in query strings as a space. If you need %20 (for example in a URL path), replace + in the output. A literal + in the input is always encoded as %2B, so it is not confused with a space.

Why are characters like !, *, ( and ) left as they are?

They are allowed in URLs and are not encoded by the browser's standard functions, so the output matches what JavaScript's encodeURIComponent / encodeURI produce. Letters, digits and - _ . ~ are never encoded.

I get "Malformed percent-encoding" when decoding. What does it mean?

The input contains a % that is not followed by two hex digits, or the decoded bytes are not valid UTF-8 (for example text that was encoded as Shift_JIS). Check the string or encode the % itself as %25.

Is my text sent to a server?

No. Encoding and decoding run in your browser.