DevToolPal
EN

URL Encode & Decode

Percent-encode text for safe use in URLs and query strings, or decode %XX sequences back to readable text.

Runs locally, never uploaded

Options

Mode
Encode

Input

0 chars · 0 B

Output

0 chars · 0 B

What it does

URL encoding, also called percent-encoding, replaces characters that are not allowed or have a special meaning in a URL with a % followed by two hexadecimal digits. A space becomes %20, an ampersand becomes %26, and non-ASCII text such as 中文 is first converted to UTF-8 bytes and then each byte is written as %XX.

This tool encodes text so you can put it safely into a query string, a path segment or an API request, and decodes percent-encoded strings that you copied from logs, browser address bars or HTTP traces back into readable text.

How to use

  1. Paste text or a URL into the Input box, or click Sample.
  2. Choose Encode or Decode.
  3. When encoding, pick Component to encode a single value (for example a search term) or Full URL to keep :, /, ?, & and = intact.
  4. Turn on Space as + for HTML form data, and Each line separately to process a list of values at once.
  5. Copy or download the result. If decoding fails, the error tells you the position of the broken escape sequence.

Example

Encoding the search term hello world & more as a component gives:

hello%20world%20%26%20more

Decoding q=%E4%BD%A0%E5%A5%BD gives q=你好.

When to use which

  • Building a query string by hand: encode each value as a component, then join them with & and =.
  • Cleaning up a full link that contains spaces or Chinese characters: use Full URL so the structure of the link is preserved.
  • Reading server logs: decode with Space as + on, because many servers log form data in that format.

FAQ

› What is the difference between "Component" and "Full URL"?

Component encodes every reserved character, including / ? & = and

› Should spaces become %20 or +?

Use %20 for paths and most APIs. Use + only for HTML form data (application/x-www-form-urlencoded), which is what browsers send when a form is submitted. Turn on "Space as +" for that case.

› Why do I get "not valid UTF-8" when decoding?

The %XX bytes do not form a complete UTF-8 character, usually because the text was cut in the middle of a multi-byte character or was encoded with a legacy charset such as GBK or Latin-1.

› Is my data sent to a server?

No. Encoding and decoding run entirely in your browser.