xdotjson-convert Install $ npm install -g xdotjson-convert Convert your dot file to a json file and then back $ dot -Txdot_json mygraph.dot > mygraph.json $ cat mygraph.json | xdotjson-convert > mygraphconverted.dot