# YAML to JSON

`yaml-to-json` · version 1.0.0 · YAML, TOML, INI, XML & TSV · free, no key needed

Convert a YAML string to a JSON object or array.

**Use when you need to: yaml to json · parse yaml · convert yaml to json.**

## Supported

- yaml to json
- parse yaml
- convert yaml to json

## Not supported

- json to yaml
- read files
- fetch urls
- execute yaml code

## Behavior

- Parses YAML syntax and returns the equivalent JSON representation.
- Complex types like dates, Infinity, and Buffer are rejected strictly.
- Disables arbitrary code execution and tags by default for safety.

## Input

- `yaml` (string, required): max length 262144

## Output

- object or array or string or number or boolean or null

## Limits

- max input bytes: 262144

## Example

Request input:

```json
{
  "yaml": "name: Ada\ncity: London\n"
}
```

Response:

```json
{
  "result": {
    "name": "Ada",
    "city": "London"
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "yaml-to-json",
  "version": "1.0.0",
  "input": {
    "yaml": "name: Ada\ncity: London\n"
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/yaml-to-json/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"yaml":"name: Ada\ncity: London\n"}'
```

The machine-readable contract is at [/v1/tools/yaml-to-json/versions/1.0.0](/v1/tools/yaml-to-json/versions/1.0.0).

### CLI

```sh
node cli.mjs run yaml-to-json 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [INI to JSON](/tools/ini-to-json): Convert an INI string to a JSON object.
- [JSON to YAML](/tools/json-to-yaml): Convert JSON data to a YAML string.
- [TOML to JSON](/tools/toml-to-json): Convert a TOML string to a JSON object.
- [TSV to JSON](/tools/tsv-to-json): Convert a complete TSV document into an array of string-valued objects.
- [XML to JSON](/tools/xml-to-json): Convert an XML string to a JSON object.
- [JSON to INI](/tools/json-to-ini): Convert JSON data to an INI string.
