URL encoder and decoder

Percent-encode text for use in a URL, or decode it. Works on one value or a whole URL.

Input

The text or URL to encode or decode.
Encode to percent-escapes, or decode them.
"component" treats the text as one value and escapes every reserved character. "full" treats it as a whole URL and keeps : / ? & = # in place.
Treat "+" as a space when decoding, and write spaces as "+" when encoding, as HTML forms do.

Result

Fill in the input and press Run.

Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.

Use it from code or an agent

curl -s https://setget.net/v1/tools/url-encode \
  -H 'Content-Type: application/json' \
  -d '{"input":{"text":"hello world & more/stuff?"}}'
import json, urllib.request

body = {'input': {'text': 'hello world & more/stuff?'}}
request = urllib.request.Request("https://setget.net/v1/tools/url-encode", json.dumps(body).encode(),
                                 {"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/url-encode", {
  method: "POST",
  headers: {"Content-Type": "application/json"},
  body: JSON.stringify({"input":{"text":"hello world & more/stuff?"}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
  "slug": "url-encode",
  "input": {
    "text": "hello world & more/stuff?"
  }
}
{
  "input": {
    "text": "hello world & more/stuff?"
  }
}

Endpoint: POST /v1/tools/url-encode. Over MCP: run_tool with slug: "url-encode". Machine-readable: input schema, Markdown. Connect an agent.

Inputs

NameTypeRequiredWhat it does
text string yes The text or URL to encode or decode.
action string no Encode to percent-escapes, or decode them. One of: encode, decode. Default: "encode".
mode string no "component" treats the text as one value and escapes every reserved character. "full" treats it as a whole URL and keeps : / ? & = # in place. One of: component, full. Default: "component".
plus_for_space boolean no Treat "+" as a space when decoding, and write spaces as "+" when encoding, as HTML forms do. Default: false.

Examples

Input
{
  "text": "hello world & more/stuff?"
}
Result
{
  "text": "hello%20world%20%26%20more%2Fstuff%3F"
}

A whole URL keeps its structure

Input
{
  "text": "https://example.com/café menu?q=a b&lang=en",
  "mode": "full"
}
Result
{
  "text": "https://example.com/caf%C3%A9%20menu?q=a%20b&lang=en"
}

Decoding form data

Input
{
  "text": "q=caf%C3%A9+au+lait%21",
  "action": "decode",
  "plus_for_space": true
}
Result
{
  "text": "q=café au lait!",
  "invalid_utf8": false
}

Questions

Should I use component or full?
Use "component" for a single value you are putting into a URL, such as a search term. Use "full" when you have a complete URL and only want unsafe characters such as spaces fixed.
When is "+" a space?
Only in form data and query strings written by HTML forms. Elsewhere "+" is a literal plus, so the option is off by default.
Does full mode encode a URL twice?
No. Escapes that are already there, such as %20, are left alone. A stray "%" becomes %25.