Skip to content
a command line tool convert from yaml to json
Branch: master
Clone or download
Latest commit 861f66b May 1, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
vendor/ fix #13 Nov 6, 2018
y2jBuilder save Sep 8, 2018
.gitignore adding goland files to .gitignore Jul 23, 2018
LICENSE mit license Nov 14, 2013 save May 1, 2019
main.go save Sep 8, 2018


Transform yaml string to json string without the type infomation.


  • zero config.
  • supports Windows, Linux, macOS, FreeBSD, NetBSD, OpenBSD, Plan 9 etc..

Binary installation and usage

  • Download a binary that match your operation system and platform.
  • copy it to /usr/local/bin like (cp ~/Downloads/yaml2json_darwin_amd64 /usr/local/bin/yaml2json )
  • Use chmod +x /usr/local/bin/yaml2json give running permission to it.

mac/linux usage

  • echo "a: 1" | yaml2json
  • yaml2json < 1.yml > 2.json

window usage

  • windows 7 cmd.exe:
C:\tmp>more .\1.yaml
a: 1

C:\tmp>.\yaml2json_windows_amd64.exe < ./1.yaml > 2.json

C:\tmp>more .\2.json
  • windows 7 powerShell 6.1.7600 file example:
PS C:\tmp> more .\1.yaml
a: 1

PS C:\tmp> Get-Content .\1.yaml | .\yaml2json_windows_amd64.exe > .\2.json
PS C:\tmp> more .\2.json

Library installation

  • go get -v


  • Follow example is for develop on mac and linux. It should work to windows too. (need change some command line and path to work on windows).
  • You need a golang on your computer.
  • Create a new directory as your workspace, like ~/work/yaml2json
  • Change your current work directory to that directory.
cd ~/work/yaml2json
GOPATH=`pwd` go get -v
GOPATH=`pwd` go run
  • use the file at $GOPATH/tmp/file to distribute your binary to others.


  • if you don't know whether your platform is 386 or amd64, use the 386 build...
  • Library api is not easy to use, it will better in next version.


You can’t perform that action at this time.