x402AgentTools

🔗URL Encoder / Decoder

Percent-encode text for safe inclusion in URLs and query strings, or decode percent-encoded text back. Uses the standard encodeURIComponent rules.

Worked examples

Encode "hello world & more"

GET /api/v1/dev/url-encoder?text=hello%20world%20%26%20more&op=encode

Result: hello%20world%20%26%20more

Encode "Grüße ☺"

GET /api/v1/dev/url-encoder?text=Gr%C3%BC%C3%9Fe%20%E2%98%BA&op=encode

Result: Gr%C3%BC%C3%9Fe%20%E2%98%BA

Decode "hello%20world%26more"

GET /api/v1/dev/url-encoder?text=hello%2520world%2526more&op=decode

Result: hello world&more

Machine API (x402)

$0.001 / call

This tool is also a JSON API for AI agents. Requests without payment receive 402 Payment Required plus instructions; agents pay USDC on Base via the x402 protocol — no accounts, no API keys.

GET /api/v1/dev/url-encoder?text=hello%20world%20%26%20more&op=encode HTTP/1.1
Host: agenttools-hub.vercel.app

→ 402 (payment required, instructions in headers)
→ 200 (after X-PAYMENT header; JSON body below)

{
  "tool": "dev/url-encoder",
  "input": {"text":"hello world & more","op":"encode"},
  "result": { "value": null, "answer": "hello%20world%20%26%20more" }
}

Agent docs: /llms.txt · OpenAPI spec · integration guide

About this tool

Percent-encoding makes arbitrary text safe inside URLs: every byte outside the unreserved set becomes %XX. Decoding also accepts + as space, matching HTML form submission behavior.

byte → '%' + two hex digits (all bytes except A–Z a–z 0–9 - _ . ! ~ * ' ( ))

Frequently asked questions

When do I need to URL-encode?

Whenever a value goes into a query string and contains spaces, & (the parameter separator), = (the key/value separator), or non-ASCII characters.

What is the difference from base64?

Both make text transport-safe, but percent-encoding stays human-readable and URL-native; base64 is more compact for binary data but not URL-safe without the base64url variant.

Related tools