---
name: "buf-convert"
section: "1"
platform: "linux"
package: "buf"
version: "1.75.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/buf-convert"
---

# buf-convert(1)

Convert a message between binary, text, or JSON

## NAME

buf-convert - Convert a message between binary, text, or JSON

## SYNOPSIS

**buf convert  \[flags\]**

## DESCRIPTION

Use an input proto to interpret a proto/json message and convert it to a different format.

Examples:

```
$ buf convert <input> --type=<type> --from=<payload> --to=<output>
```

The  can be a local .proto file, binary output of "buf build", bsr module or local buf module:

```
$ buf convert example.proto --type=Foo.proto --from=payload.json --to=output.binpb
```

All of , "--from" and "to" accept formatting options:

```
$ buf convert example.proto#format=binpb --type=buf.Foo --from=payload#format=json --to=out#format=json
```

Both  and "--from" accept stdin redirecting:

```
$ buf convert <(buf build -o -)#format=binpb --type=foo.Bar --from=<(echo "{\"one\":\"55\"}")#format=json
```

Redirect from stdin to --from:

```
$ echo "{\"one\":\"55\"}" | buf convert buf.proto --type buf.Foo --from -#format=json
```

Redirect from stdin to :

```
$ buf build -o - | buf convert -#format=binpb --type buf.Foo --from=payload.json
```

Use a module on the bsr:

```
$ buf convert <buf.build/owner/repository> --type buf.Foo --from=payload.json
```

## OPTIONS

**--disable-symlinks**\[=false\]\
 	Do not follow symlinks when reading sources or configuration from the local filesystem By default, symlinks are followed in this CLI, but never followed on the Buf Schema Registry

**--error-format**="text"\
 	The format for build errors printed to stderr. Must be one of \[text,json,msvs,junit,github-actions,gitlab-code-quality\]

**--from**="-"\
 	The location of the payload to be converted. Supported formats are \[binpb,json,txtpb,yaml\]

**-h**, **--help**\[=false\]\
 	help for convert

**--to**="-"\
 	The output location of the conversion. Supported formats are \[binpb,json,txtpb,yaml\]

**--type**=""\
 	The full type name of the message within the input (e.g. acme.weather.v1.Units)

**--validate**\[=false\]\
 	Validate the message specified with --from by applying protovalidate rules to it. See https://github.com/bufbuild/protovalidate for more details.

## OPTIONS INHERITED FROM PARENT COMMANDS

**--debug**\[=false\]\
 	Turn on debug logging (env BUF\_DEBUG)

**--log-format**="color"\
 	The log format text,color,json ⟨env BUF\_LOG\_FORMAT⟩

**--timeout**=0s\
 	The duration until timing out, setting it to 0 means no timeout (env BUF\_TIMEOUT)

## SEE ALSO

**[buf(1)](/buf/1.md)**

## HISTORY

2026-10-22 Auto generated by spf13/cobra
