# JSON to TSV

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

Convert a JSON array of objects to a TSV string.

**Use when you need to: json to tsv · stringify tsv · convert json to tsv.**

## Supported

- json to tsv
- stringify tsv
- convert json to tsv

## Not supported

- tsv to json
- read files
- write files

## Behavior

- Converts an array of flat objects into a TSV document.
- The headers are determined by the complete union of keys across all objects, in order of appearance.
- Objects missing a header get an empty string.
- Nested objects and arrays within cells are strictly rejected.

## Input

- `data` (array of object, required): max items 5000

## Output

- `tsv` (string, required)

## Limits

- max data rows: 5000
- max columns: 256

## Example

Request input:

```json
{
  "data": [
    {
      "name": "Ada",
      "city": "London"
    }
  ]
}
```

Response:

```json
{
  "result": {
    "tsv": "name\tcity\nAda\tLondon\n"
  }
}
```

## How to call it

### MCP

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

```json
{
  "id": "json-to-tsv",
  "version": "1.0.0",
  "input": {
    "data": [
      {
        "name": "Ada",
        "city": "London"
      }
    ]
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/json-to-tsv/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"data":[{"name":"Ada","city":"London"}]}'
```

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

### CLI

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

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

## Related tools

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