{"uid":"cap_LymptJ77Qj5HLiWJe0c4w","slug":"url-text-tools-percent-encode-decode-0ce59bf8","name":"URL & Text Tools – Percent Encode/Decode","description":"Percent-encode or decode text as URL component, path, query or form data (UTF-8), with byte counts.","url":"https://url-text-tools.x402tookit.com/percent-encode?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["text"],"properties":{"mode":{"type":"string","description":"component (default), path, query or form; form turns spaces into +"},"text":{"type":"string","description":"The text to encode or decode (up to 2000 characters)"},"action":{"type":"string","description":"encode (default) or decode"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"asOf":{"type":["null","string"]},"mode":{"type":["null","string"]},"input":{"type":["null","string"]},"action":{"type":["null","string"]},"output":{"type":["null","string"]},"source":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"summary":{"type":["null","string"]},"verdict":{"type":["null","string"]},"degraded":{"type":["boolean","null"]},"disclaimer":{"type":["null","string"]},"inputBytes":{"type":["null","number"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"outputLength":{"type":["null","number"]}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_4raz-dS4o3SSZQ1kREYCr","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Percent-encodes or decodes text as a URL component, path, query string, or form data (UTF-8), returning the transformed string with byte counts.","exampleAgentPrompt":"Percent-encode this text for use as a URL query parameter: 'hello world & goodbye!'","exampleUseCases":[{"title":"Encode user input for safe URL embedding","prompt":"I need to embed the text 'café au lait & croissants?' safely as a URL query parameter — can you percent-encode it in query mode?"},{"title":"Decode a garbled percent-encoded string","prompt":"I've got this encoded URL chunk — '%E2%82%AC100%20off%20sale!' — can you decode it back to readable text?"},{"title":"Encode form data with plus signs for spaces","prompt":"Encode 'hello world foo bar' as form data so spaces become plus signs instead of %20, using form mode."}],"resultDescription":"Returns the encoded or decoded text string along with the input byte count, output length, the mode used (component/path/query/form), the action performed (encode/decode), a summary, and metadata such as the timestamp. Optionally includes degraded status and disclaimer fields.","failureModes":["Missing required 'text' query parameter returns an error","Text exceeding 2000 characters may be rejected or truncated","Invalid 'mode' value (not component/path/query/form) may default to component or return an error","Invalid 'action' value (not encode/decode) may default to encode","Non-UTF-8 input may produce unexpected results","Payment failure (402) if USDC balance is insufficient"],"whenToPreferThis":"Use this endpoint when you need reliable, RFC-compliant percent-encoding or decoding of text for URL construction, especially when you need fine-grained control over the encoding context (component vs path vs query vs form). Prefer it over ad-hoc encoding in code when correctness of special characters (e.g. spaces as + in form mode, reserved characters in path vs query) matters and you want byte-level metadata about the transformation.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T07:20:27.020Z","isFirstParty":false,"canonicalSlug":"url-text-tools-percent-encode-decode-0ce59bf8"}