---
title: Converters
description: Convert between JSON/YAML and CSV/JSON formats.
---

# Converters

Convert data between different formats.

## JSON ↔ YAML

Auto-detects the input format and converts to the other:

```bash
# JSON to YAML
echo '{"name":"devv","version":1}' | devv pipe exec "json-yaml-converter"

# YAML to JSON
echo "name: devv\nversion: 1" | devv pipe exec "json-yaml-converter"
```

### Output

```bash
$ echo '{"name":"devv","version":1}' | devv pipe exec "json-yaml-converter"
name: devv
version: 1

$ echo "name: devv" | devv pipe exec "json-yaml-converter"
{"name":"devv"}
```

## CSV → JSON

Convert CSV data to a JSON array:

```bash
echo "name,age\njosh,30\ndevv,1" | devv pipe exec "csv-json-converter"
cat export.csv | devv pipe exec "csv-json-converter | json-formatter"
```

### Output

```bash
$ echo "name,age\njosh,30" | devv pipe exec "csv-json-converter"
[{"name":"josh","age":"30"}]
```

## Pipeline Usage

| Pipeline ID | Description |
|-------------|-------------|
| `json-yaml-converter` | Convert JSON↔YAML (auto-detect) |
| `csv-json-converter` | Convert CSV to JSON array |

```bash
devv pipe exec "csv-json-converter | json-formatter" "name,email\njosh,j@x.com"
devv pipe exec "json-yaml-converter | base64-encode" '{"key":"value"}'
```

### Behavior

Both transform their input — the converted result passes to the next step.
