{"uid":"cap_vlEGdjAyKw-zMDCqmshYh","slug":"json-and-data-tools-encode-decode-503dc61b","name":"JSON and Data Tools – Encode/Decode","description":"Encode or decode text as base64, base64url, hex, URL percent-encoding or HTML entities; invalid input is reported, not guessed.","url":"https://json-data-tools.x402tookit.com/encode-decode?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","mode"],"properties":{"mode":{"type":"string","description":"base64, base64url, hex, url or html"},"text":{"type":"string","description":"Text to convert"},"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"]},"action":{"type":["null","string"]},"result":{"type":["null","string"]},"source":{"type":["null","string"]},"reasons":{"type":["array","null"]},"summary":{"type":["null","string"]},"verdict":{"type":["null","string"]},"degraded":{"type":["boolean","null"]},"disclaimer":{"type":["null","string"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}}}}}}}},"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_8u3dvQGZoxDeWgPFYYSM-","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":"Encodes or decodes text using base64, base64url, hex, URL percent-encoding, or HTML entities, with strict error reporting on invalid input.","exampleAgentPrompt":"Can you base64-encode the text 'Hello, World!' for me? I need the standard base64 output, not the URL-safe variant.","exampleUseCases":[{"title":"Decode a base64 API token","prompt":"I received this base64-encoded token from an API response: 'SGVsbG8gV29ybGQ=' — can you decode it back to plain text?"},{"title":"URL-encode a query string value","prompt":"I need to safely embed this text in a URL query parameter: 'search term with spaces & special chars=yes' — can you URL percent-encode it?"},{"title":"HTML-encode user content before display","prompt":"Before I insert this user-submitted text into an HTML page, can you HTML-entity-encode it so special characters like <, >, and & are safe? The text is: '<script>alert(1)</script>'"}],"resultDescription":"Returns a JSON object containing the converted result string, the encoding mode used, the action performed (encode or decode), the source text, and a summary. If the input is invalid for the chosen mode, error reasons are returned rather than a guessed output.","failureModes":["Invalid base64/hex/encoded input returns error reasons array instead of a result","Missing required 'text' or 'mode' query parameter results in an error response","Unsupported mode value returns an error","Malformed percent-encoding or HTML entities cause decode failures with explicit error messages"],"whenToPreferThis":"Choose this endpoint when you need strict, deterministic encoding or decoding of text in one of the five supported formats (base64, base64url, hex, URL, HTML) and require reliable error reporting rather than best-effort guessing on invalid input. Ideal for agent pipelines where correctness matters and silent failures on bad input are unacceptable.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-27T06:25:18.249Z","isFirstParty":false,"canonicalSlug":"json-and-data-tools-encode-decode-503dc61b"}