# JSON and Data Tools – Encode/Decode

> JSON and Data Tools – Encode/Decode is a paid API for AI agents from json-data-tools.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-27).

Encodes or decodes text using base64, base64url, hex, URL percent-encoding, or HTML entities, with strict error reporting on invalid input.

## Facts

- Endpoint: GET https://json-data-tools.x402tookit.com/encode-decode?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-27
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/json-and-data-tools-encode-decode-503dc61b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_vlEGdjAyKw-zMDCqmshYh

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability json-and-data-tools-encode-decode-503dc61b
```

Example prompt: Can you base64-encode the text 'Hello, World!' for me? I need the standard base64 output, not the URL-safe variant.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

Encode or decode text as base64, base64url, hex, URL percent-encoding or HTML entities; invalid input is reported, not guessed.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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"
       }
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/json-and-data-tools-encode-decode-503dc61b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from json-data-tools.x402tookit.com](https://www.zero.xyz/host/json-data-tools.x402tookit.com/llms.txt)
